Two versions of swr(git submodules) #2148
Unanswered
sandbox4013
asked this question in
Q&A
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a project which uses git submodule
Both project and submodule uses swr
Same version - 1.0.1, because any new npm package in submodule requires to have same one in project
Anyway, problem is if some component(let's say Container) from submodule uses useSWR, it doesn't see SWRConfig of project
If I move Container to project, then everything fine
Eg, this won't work if there's real submodule.
https://codesandbox.io/s/vigilant-hugle-xqy0ro?file=/src/App.jsx
Unfortunately, I didn't find a way to add real submodule to codesandbox
I could create two github repositories to recreate issue if needed
Does anyone know how to 'merge' multiple swrs contexts?
Beta Was this translation helpful? Give feedback.
All reactions