vikejs / vike-react

🔨 React integration for Vike
https://vike.dev/vike-react
MIT License
105 stars 16 forks source link

feat: useData() #50

Closed lourot closed 10 months ago

lourot commented 10 months ago
  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 commented 10 months ago

👌 Good idea to use data.title.

WDYT of 6a87d62937e25fc142b42365344a093b89cf5e3b? 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 commented 10 months ago

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

  1. we land this and release as vike-react@0.3.8
  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 vike-react@0.4.0

WDYT?

brillout commented 10 months ago

👍 Ok good idea

On Sat 23. Dec 2023 at 23:14, Aurélien Lourot @.***> wrote:

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

  1. we land this and release as @.***
  2. I create a PR for bati to switch to data() hooks with useData() (Bati relies on onBeforeRender()+pageProps) (FYI @magne4000 https://github.com/magne4000)
  3. I create a follow-up PR removing support for onBeforeRender()+ pageProps and we release it as @.***

WDYT?

— Reply to this email directly, view it on GitHub https://github.com/vikejs/vike-react/pull/50#issuecomment-1868379251, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHVQRURN4AJH4QHY2IT2WTYK5JU5AVCNFSM6AAAAABBBAZV32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYGM3TSMRVGE . You are receiving this because you commented.Message ID: @.***>

lourot commented 10 months ago

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

brillout commented 10 months ago

👍 Let me have a closer look.

brillout commented 10 months ago

LGTM :)