You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So this is CreateGroupProvider where i call useNavigate and get error cuz of it:
exportconstCreateGroupProvider=({ children }: {children: React.ReactNode})=>{// another codeconstnavigate=useNavigate();return(<CreateGroupContext.Providervalue={value}>{children}</CreateGroupContext.Provider>)}``
### ExpectedBehavioruseNavigateshouldwork
### ActualBehavioruseNavigatedoesn't work
The text was updated successfully, but these errors were encountered:
p.s. i upgraded version to latest ( 6.26.2 ) and error still appears. I really have no idea why.
p.p.s. It's looks like i loss context somehow cuz i can useNavigate inside Layout and LayoutSheet but inside CreateGroupProvider it throw error
For temporary use i decided to provide navigate function as a prop to CreateGroupProvider. It looks ugly but it works and i really don't know what to do with this error.
What version of React Router are you using?
6.22.3
Steps to Reproduce
I know this error happen cuz of calling hook outside of router context. But it's actually inside context.
Here is my main.tsx:
this is my router:
baseLayout:
layout:
and finally this is my LayoutSheet where error appears when i call create group:
So this is CreateGroupProvider where i call useNavigate and get error cuz of it:
The text was updated successfully, but these errors were encountered: