-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to vike-react-redux
?
#87
Comments
The general idea here is that For example, after @yoshi2no implemented In the meantime, the question is: what do you need from What you'll most liklely need is to be able to wrap the root component, for that you can see how Beyond a Redux wrapper, do you need something else? I guess a way to pass the Redux store from the server to the client-side? Let me know if that all makes sense. Also, if you're up for it, PR welcome that adds |
Nice I'll bee looking out for I'm currently using redux along the lines of official vike redux example BUT instead of using As mofiying +onBeforeRenderclient.tsx causes an additional POST request when navigating clientside slowing down the navigation
I've been able to completely avoid the additional If you'd give me a hint on how to achive that whilst using |
How about a new hook |
Ok interesting yes, this would also prob solve the use case I posted in I would still have to understand how to use this on inject the |
I'm not sure what you mean, but feel free to suggest something else than creating a new custom hook |
What eactly would I'd like to:
|
+Wrapper.tsx const pageContext = usePageContext()
const [store] = useState(() => getStore(pageContext.PRELOADED_STATE))`
...
return <Provider store={store}>...</Provider> |
But this would also cause an additional POST request on client side navigation. If the user loads e.g.: But from my experiments, as soon as I use I think this is just inherently how |
My thinking was that |
I'm not sure if I understand correctly:
But if I could see how it would work with a Since I still think the only way to avoid that vike send a Correct me if I'm wrong or let me know if I should try to further clarify, thanks for taking the time! |
Thanks! So afaik ✅ client-side page-based fetching Or is the second case possible in the current However, I do now have a setup Redux + Vike such that:
I'd still like to migrate to vike-react at some point but don't see any benefits at the moment / I only fear that I might accidentally use some vike stuff that will be deprecated in the future. So this isn't a high priority for me anymore! I'm happy ;) I do have some special requirements like injecting URL params into the Redux state and passing some cookies through page context, and I (could) also achieve point 2 sorta by adding some route-based fetch calls to
|
We've added a new hook Contribution welcome for:
We've added https://vike.dev/hooks#order. |
Updated docs: |
I'm trying to follow the docs (https://vike.dev/stores) to setup redux but |
@cwagner22 Indeed it's missing, let me implement it. |
Done & released in |
@cwagner22 In case your up for it, contribution welcome to create |
Hi saw the open pull #57 🚀, I'm very interested in something similar for redux.
But adding a full abstraction over redux seems a little overkill for my case ( & annoying to maintain? )
I'd rather just be able to add a redux provider and global store to
renderHtml
&renderClient
,whilst using
vike-react
but without maintaining a seperate plug-in?Is it already possible to redux with
vike-react
? ( I didn't manage )How would one integrate it? ( or does it really require a separate plugin? )
The text was updated successfully, but these errors were encountered: