-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Feature Request: Next.js Support #4
Comments
I haven't used next.js before, and as reactivue is kinda a low level thing, it should work for whatever supports react. Is there anything I should do to support next.js? Thanks |
Keeping data in sync between server side render and client side hydration is one of the first requirements of server side rendered apps. That because nuxt implementation of composition api have ssrRef. Here it is an example how mobx-react implemented in next.js: In addition, current build output is not working in Next.js. I get this error on freshly created next app: |
@sibbngheid Thanks for the info. That's interesting to know. I will have a look :) |
reactivue/packages/reactivue/rollup.config.js Lines 12 to 13 in e942355
Adding |
@sibbngheid Oh, I see. It's probably because I have override the
Will check it out, thanks for the info |
Just released 0.2.1 and this should be hopefully fixed :) |
Works 👌 I'm trying to handle server side data with getServerSideProps . It is works fine. But there is a weird error on globally shared refs. Steps to reproduce: https://github.com/sibbngheid/issue-4
in 5th step react fires an error on console But everything is work as expected. |
I think get it working on just-works branch. https://github.com/sibbngheid/issue-4/tree/just-works I move my data logic to Then I try to use useEffect with data comes server, and it is works as expected 🎉 If I'm not missing something... 🤔 |
@sibbngheid Thanks for working on this, and congrats that you made it work! However, I have just pull your code on the |
I don't know what is your question exactly about. Can you make it clear? |
@sibbngheid
Everything works fine with me(well done!). Wondering why the error occurs to you. |
Move |
I think using useEffect is a good approach here. One other solution might be something like |
No, this code will not work. It is not different than not using it. What React's not happy about in here is, updating parent component while still rendering current component. Error message is clear enough: useEffect defers update as described in docs. While setCount method is bound to parent component's context via useSetup and passing them to child component via props is not makes them bounded to child component's effect cycle (I think). I think we can get the effect of what useEffect does here by bounding setup to current component by passing props to something like Maybe, I'm can be totally wrong. I'm not sure how React works internally. |
Is this project abandoned? There has been no activity in months, and it's an excellent project!! Will there be a stable version soon? |
@Dav3rs This is definitely not abandoned. Instead, I don't see it being used that much. You can still use it and if you find any bugs, just raise an issue so we can look into it. Thanks. |
Ok thanks! I have been waiting to use it because of this warning:
It scares a little. (O_o), maybe now that vue3 was released you can remove that warning. |
@Dav3rs Thanks, I have removed that line as I don't expect big breaking changes in the foresee future. When we need to do some changes, we will follow semver for sure.
well maybe, but I doubt if I had time to do so. I am not working with React for now. I might not be able to work on it actively. However, I will triage issues and reviewing PRs actively for my projects. So if you like it, just used it and raise PRs if you faced any problem. I could also give access to people who have contributed to a certain point. Thanks. |
No description provided.
The text was updated successfully, but these errors were encountered: