Skip to content

Commit

Permalink
Update handlers before render
Browse files Browse the repository at this point in the history
  • Loading branch information
poffdeluxe committed Oct 27, 2020
1 parent 5b10096 commit 9992271
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,13 @@ export const RenderWithFn: FC<Props> = ({
[]
);

useEffect(() => {
const render = useCallback(() => {
if (!isEqual(handlers.current, incomingHandlers)) {
handlers.current = incomingHandlers;
}
}, [incomingHandlers]);

const render = useCallback(() => {
renderFn(renderTarget.current!, config, handlers.current);
}, [renderTarget, config, renderFn]);
}, [renderTarget, config, renderFn, incomingHandlers]);

useEffect(() => {
if (!domNode) {
Expand Down

0 comments on commit 9992271

Please sign in to comment.