Replies: 1 comment 1 reply
-
context cannot pierce from on renderer into another in react. either use a context bridge https://github.com/pmndrs/drei#usecontextbridge and for this react-router must expose their context somehow, or use a router is not constrained by context like wouter: https://codesandbox.io/s/r3f-wouter-routes-7kohn |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am trying to create a mesh with a function attached to redirect user to another page. What is the best way for me to do this? I have tried a few methods, including useHistory
Imported as:
import { Redirect, useHistory } from 'react-router-dom';
In the functional component:
The mesh:
Error I am getting is "Cannot read property 'push' of undefined", is this because I have not imported history properly?
https://stackoverflow.com/questions/29244731/react-router-how-to-manually-invoke-link using this as a reference, could I implement useState and Redirect instead of history?
Thanks for your help
Beta Was this translation helpful? Give feedback.
All reactions