Skip to content
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

feat: useData() #50

Merged
merged 3 commits into from
Dec 24, 2023
Merged

feat: useData() #50

merged 3 commits into from
Dec 24, 2023

Conversation

lourot
Copy link
Contributor

@lourot lourot commented Dec 23, 2023

  1. adding useData() to vike-react
  2. while staying backward compatible with onBeforeRender-based projects
  3. copying basic example to examples/onBeforeRender
  4. changing basic example from using onBeforeRender to using data+useData()

@brillout
Copy link
Member

👌 Good idea to use data.title.

WDYT of 6a87d62? I think we could even do it now and release a breaking change. Making our a life a little easier for replicating this PR to vike-vue and vike-solid. Thoughts?

@lourot
Copy link
Contributor Author

lourot commented Dec 23, 2023

Good idea, but I suggest we make it in several PRs:

  1. we land this and release as [email protected]
  2. I create a PR for bati to switch to data() hooks with useData() (Bati relies on onBeforeRender()+pageProps) (FYI @magne4000)
  3. I create a follow-up PR removing support for onBeforeRender()+pageProps and we release it as [email protected]

WDYT?

@brillout
Copy link
Member

brillout commented Dec 23, 2023 via email

@lourot
Copy link
Contributor Author

lourot commented Dec 23, 2023

Let me know if you need more time to review this or if this can land. Thanks :)

@brillout
Copy link
Member

👍 Let me have a closer look.

@brillout
Copy link
Member

LGTM :)

@lourot lourot merged commit ac85dd4 into main Dec 24, 2023
30 checks passed
@lourot lourot deleted the aurelien/feature/useData branch December 24, 2023 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants