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

[REF-3219] use hooks.useState will raise: ValueError: Can not compile, the tag useState is used multiple time from react and react #3604

Closed
seewindcn opened this issue Jul 1, 2024 · 4 comments · Fixed by #3749
Assignees
Labels
linear Created by Linear-GitHub Sync Low priority Created by Linear-GitHub Sync Reflex > Open source core OSS Created by Linear-GitHub Sync
Milestone

Comments

@seewindcn
Copy link
Contributor

seewindcn commented Jul 1, 2024

Describe the bug
A clear and concise description of what the bug is.
use hooks.useState, will raise: ValueError: Can not compile, the tag useState is used multiple time from react and react

hooks._compose_react_imports function, create ImportVar object with install=False; and in banner.py, ConnectionToaster.add_hooks create ImportVar object with install=True;

these will make compler.validate_imports raise ValueError.

REF-3219

@seewindcn seewindcn added the bug Something isn't working label Jul 1, 2024
@masenf masenf added the linear Created by Linear-GitHub Sync label Jul 1, 2024
@masenf masenf changed the title use hooks.useState will raise: ValueError: Can not compile, the tag useState is used multiple time from react and react [REF-3219] use hooks.useState will raise: ValueError: Can not compile, the tag useState is used multiple time from react and react Jul 1, 2024
@masenf
Copy link
Collaborator

masenf commented Jul 1, 2024

should be a simple enough fix to get rid of the install=False in _compose_react_imports

@masenf masenf modified the milestones: Open Source Bugs, v.41 Jul 2, 2024
@Lendemor
Copy link
Collaborator

Lendemor commented Jul 3, 2024

I think install=Falseis correct though (even if we have a special case that exclude installing react dynamically since it's installed during `init`)
I'd rather set it to False in `ConnectionToaster.add_hooks`

@masenf
Copy link
Collaborator

masenf commented Jul 3, 2024

We could also merge that patch that moves the install special cases to ImportVar.__init__ or similar. Then it wouldn't matter how it was specified in different places.

@masenf masenf modified the milestones: v.41, v.42 Jul 7, 2024
@Lendemor
Copy link
Collaborator

We could also merge that patch that moves the install special cases to ImportVar.__init__ or similar. Then it wouldn't matter how it was specified in different places.

I'd be fine with that, do you have the id of the PR containing that patch if it's waiting/ready for review?

@masenf masenf added this to the v.44 milestone Jul 24, 2024
@masenf masenf modified the milestones: v.44, v.45 Jul 28, 2024
@masenf masenf added Low priority Created by Linear-GitHub Sync and removed high priority labels Jul 30, 2024
@masenf masenf modified the milestones: v.45, v.46 Aug 4, 2024
@masenf masenf modified the milestones: v.46, v.47 Aug 11, 2024
@masenf masenf added Reflex > Open source core OSS Created by Linear-GitHub Sync bug Something isn't working and removed bug Something isn't working labels Sep 3, 2024
@masenf masenf added bug Something isn't working and removed bug Something isn't working labels Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear Created by Linear-GitHub Sync Low priority Created by Linear-GitHub Sync Reflex > Open source core OSS Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants