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

DUIX doesn't work in React with Hooks #27

Open
BrodaNoel opened this issue Apr 16, 2022 · 2 comments
Open

DUIX doesn't work in React with Hooks #27

BrodaNoel opened this issue Apr 16, 2022 · 2 comments
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Comments

@BrodaNoel
Copy link
Owner

If you are doing:

useEffect(() => {
  duix.subscribe('user', setUser)
}, []);

The setUser function is going to get old in the following render.
We have to find a way to keep it simple, but fix it.

I think we should not create a useDuix(), because the idea is to keep DUIX as a state manager based on events.

@BrodaNoel BrodaNoel added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed labels Apr 16, 2022
@BrodaNoel
Copy link
Owner Author

@jehon are you using React? You may have the same problem if you do.

@jehon
Copy link
Contributor

jehon commented Apr 22, 2022

What is your setUser function?
Try with () => setUser() ?

No, I am not using React

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants