useLocation
hook from react-router-dom
to get the current URL.
useState
hook to create a state variable called source
and a setter function called setSource
. We are then using the useEffect
hook to set the source to the current location.
facebook
and web3
views.
useState
hook to create a state variable called viewOverrides
and a setter function called setViewOverrides
.
useEffect
hook to set the view overrides to the correct view based on the source.
DynamicContextProvider
.