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

Do not use state and effects within react-jhipster #19633

Closed
1 task done
Tcharl opened this issue Sep 5, 2022 · 2 comments · May be fixed by #19560
Closed
1 task done

Do not use state and effects within react-jhipster #19633

Tcharl opened this issue Sep 5, 2022 · 2 comments · May be fixed by #19560

Comments

@Tcharl
Copy link
Contributor

Tcharl commented Sep 5, 2022

Overview of the feature request

The goal of this FR being to get rid of useState and useEffect within react-jhipster library.
The approach would be to create dedicated react elements by input kind (text, date, numbers, ...) and to keep using react-forms api, instead of using the actual reflection-intensive, not that easy to debug, React form wrapper

Motivation for or Use Case

Newest React version now forbids the use of state and effects within a library.

Related issues or PR

POC here: #19560
First react element here: jhipster/react-jhipster#87

  • Checking this box is mandatory (this is just to show you read everything)
@emilpaw
Copy link
Contributor

emilpaw commented Sep 11, 2022

Newest React version now forbids the use of state and effects within a library.

What makes you think that? react-hook-form uses useState and useEffect so why shouldn't react-jhipster be able to do that too?

@Tcharl
Copy link
Contributor Author

Tcharl commented Sep 11, 2022

react-jhipster is a library (equivalent to a bunch of jsx.elements). useState should be at the component level.
You can see the behavior when upgrading the version of react in the library (edit the package.json, switch to latest or the same as the generator): nothing will work anymore (try with a blobfield)

@Tcharl Tcharl linked a pull request Sep 12, 2022 that will close this issue
6 tasks
@Tcharl Tcharl closed this as completed Oct 23, 2022
@DanielFran DanielFran added this to the 8.0.0-beta.1 milestone Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants