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

please add app directory for with-zustand example #52858

Closed
1 task done
sinafath opened this issue Jul 19, 2023 · 6 comments · Fixed by #58042
Closed
1 task done

please add app directory for with-zustand example #52858

sinafath opened this issue Jul 19, 2023 · 6 comments · Fixed by #58042
Labels
examples Issue/PR related to examples good first issue Easy to fix issues, good for newcomers locked

Comments

@sinafath
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

**

Which example does this report relate to?

with-zustand

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

there is no example of Zustand with new next app directory. Can I use Zustand with the new app directory model?

Expected Behavior

Using zustand with app directory

To Reproduce

**

@sinafath sinafath added the examples Issue/PR related to examples label Jul 19, 2023
@balazsorban44
Copy link
Member

Hi, the preferred way would be to convert the current example at https://github.com/vercel/next.js/tree/canary/examples/with-zustand instead of adding a new one. The examples directory is community-maintained so feel free to open a PR, and we can help review it! 🙏

@balazsorban44 balazsorban44 added the good first issue Easy to fix issues, good for newcomers label Jul 19, 2023
@nicksan222
Copy link

Please assign me, i will publish the PR in 12 hours at most

@shyampathade
Copy link

Can you assign it to me please ?

@monstajoe2002
Copy link

Can you assign me this issue please?

@mhpjay422
Copy link

HI, I'm new here and gave this issue a try. No success. Details below.

When trying to convert to the app router:

  • The current initialization of the "store" uses a useRef
  • With the conversion to the app router, the initialization of the store errors saying the useRef can only be used in a client component
    CleanShot 2023-10-25 at 19 36 32
  • I know adding 'use client' wouldnt be the way to go but gave it a try and get this error
    CleanShot 2023-10-25 at 19 38 12

I tried to figure a way not to use the useRef with no luck. I am not sure how to proceed from here. Any pointers?

Copy link
Contributor

github-actions bot commented Dec 1, 2023

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot added the locked label Dec 1, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples good first issue Easy to fix issues, good for newcomers locked
Projects
None yet
6 participants