Skip to content

useWebViewState()

Call Signature

function useWebViewState(ref): NavigationState;

The navigation state of the WebView mounted with ref (a useRef, createRef or createWebViewRef one); re-renders on every change, progress included, and follows a remount.

Parameters

Parameter Type
ref RefObject<WebViewRef | null>

Returns

NavigationState

See

Navigation state example

Call Signature

function useWebViewState<T>(ref, select): T;

What select returns for the navigation state of the WebView mounted with ref; re-renders only when that changes (by Object.is), and follows a remount.

select must be pure: it can run more than once for a state, and it can be a new function at each render. A select that returns a new object or array each time re-renders on every state change, because Object.is never matches it.

Type Parameters

Type Parameter
T

Parameters

Parameter Type
ref RefObject<WebViewRef | null>
select (state) => T

Returns

T