Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Jun 14, 2022
1 parent aaa219f commit e13e9db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hooks/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export function useEffect(callback, args) {
/** @type {import('./internal').EffectHookState} */
const state = getHookState(currentIndex++, 3);
if (!options._skipEffects && argsChanged(state._args, args)) {
state._pendingValue = callback;
state._value = callback;
state._pendingArgs = args;

currentComponent.__hooks._pendingEffects.push(state);
Expand All @@ -210,7 +210,7 @@ export function useLayoutEffect(callback, args) {
/** @type {import('./internal').EffectHookState} */
const state = getHookState(currentIndex++, 4);
if (!options._skipEffects && argsChanged(state._args, args)) {
state._pendingValue = callback;
state._value = callback;
state._pendingArgs = args;

currentComponent._renderCallbacks.push(state);
Expand Down
1 change: 0 additions & 1 deletion hooks/src/internal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export type Cleanup = () => void;

export interface EffectHookState {
_value?: Effect;
_pendingValue?: any;
_args?: any[];
_pendingArgs?: any[];
_cleanup?: Cleanup | void;
Expand Down

0 comments on commit e13e9db

Please sign in to comment.