Skip to content

Commit

Permalink
fix: unecessary re-renders caused by misusage of hooks deps
Browse files Browse the repository at this point in the history
fix #5
  • Loading branch information
jsamr committed Feb 6, 2021
1 parent 7e2dbdf commit 9b1d579
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 2 additions & 0 deletions packages/webshell/etc/webshell.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ export const ForceResponsiveViewportFeature: FeatureClass<ForceResponsiveViewpor

// @public
export interface ForceResponsiveViewportOptions {
initScale?: number;
maxScale?: number;
minScale?: number;
}

// @public
Expand Down
6 changes: 1 addition & 5 deletions packages/webshell/src/hooks/useWebshell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ function useWebMessageBus(
}: WebshellInvariantProps & MinimalWebViewProps
) {
const [isLoaderReady, setIsLoaderReady] = React.useState(false);
const domHandlers = React.useMemo(() => registry.getWebHandlers(otherProps), [
otherProps,
registry
]);

const domHandlers = registry.getWebHandlers(otherProps);
const handleOnWebMessage = React.useCallback(
({ nativeEvent }: NativeSyntheticEvent<WebViewMessage>) => {
const parsedJSON = parseJSONSafe(nativeEvent.data);
Expand Down

0 comments on commit 9b1d579

Please sign in to comment.