Comments (5)
I find the changes to React useEffect in 18 confusing, and as a result, have moved on to using Fable.Lit.
But it sounds like you know what you're talking about and have a good read on the issue. I trust your judgement! ๐
from feliz.
@JordanMarr thanks for the info ๐ @Zaid-Ajaj, In that case, I think we should adjust the useEffectOnce
code to the simple alias useEffect(func, [|])
or remove it completely. If you are okay with that I will create a simple PR.
from feliz.
I think we should adjust the useEffectOnce code to the simple alias useEffect(func, [|]) ... If you are okay with that I will create a simple PR
@lukaszkrzywizna that would be awesome ๐ thanks a lot
from feliz.
@lukaszkrzywizna I admit that the changes to useEffect in React were more than I could keep up with. It sounds like there are even more Edge cases to be concerned with if you factor in โstrict modeโ (which I also was not aware of).
So the only way to fix would be to come up with a handful of use cases that should all work and verify they do. (It sounds like you have identified one case that doesnโt already).
from feliz.
@JordanMarr, which edge cases are you considering? I assumed that this was related to strict mode because I can't think of any other scenarios where useEffect would run twice. Nevertheless, we shouldn't account for strict mode in this hook since the React team introduced the double render feature to catch logic errors.
from feliz.
Related Issues (20)
- Issue version 3.10.0 when using another Router component in the inner component
- IReactProperty Question HOT 1
- Q: interesting
- add vitest to template
- useElmish vs useReducer HOT 4
- Feedback on missing docs for newcomers HOT 1
- ReactComponentAttribute for props list HOT 2
- Q: Documentation on breaking changes in 2.6? [WAS Updating Feliz.UseListener to Feliz 2.6.0] HOT 4
- CSS overflow-anchor property HOT 1
- Error with Feliz 2.7 HOT 2
- Making UseElmish's dispatch function stable
- Feliz.Markdown escapeHtml doesn't seem to work HOT 1
- UseElmish: Failed to resolve import "use-sync-external-store/shim" HOT 3
- `react-markdown` removes the `escapeHtml` property HOT 1
- Expanding Feliz.Rechart HOT 3
- Component created with a forwardRef that has generic type parameters loses state HOT 2
- "Directory import use-sync-external-store\shim is not supported" in UseElmish.fs.js HOT 2
- Use with Elmish documentation is lacking integration HOT 2
- Enhance Handling of F# Record Types as Props in ReactComponent Attribute HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feliz.