Comments (4)
Because useElmish
is already used in the application, I would stick with useElmish
for consistency and because in the future if the component needs to evolve it will avoid a re-write/translation from one system to another.
from feliz.
useReducer
is a native React feature which probably explains the lack of documentation around it. https://react.dev/reference/react/useReducer
useReducer
and useElmish
kind of overlap in term of scope but the main difference is that useElmish
should allow to use libraries from Elmish ecosystem like debouncer, etc. Plus as you noted the benefit of generated messages to handle complex.
useReducer
was introduced by the React team, to kind of include Redux
in React directly without having to install an external dependency. I am not sure if this succeeded in archiving the goal they had in mind.
You can mix them, in your application but I think for consistency it is probably better to stick with one.
from feliz.
Hi @MangelMaxime! Thanks for the insight.
Yes, I understand that useReducer is part of the React api, and also that it was a way to bundle a redux-like solution into React to manage complex state.... this is the reason I'm interested to know if is there is a place for useReducer within our app for simple situations where useState is not sufficient to manage state (because of deeply nested components) BUT useElmish might** be overkill for adding a "simple" state machine into a component. Basically, is useReducer recommended at all within a Feliz app? (or was it only added just for better coverage of the React API?).
After all, the Elmish lib it's tiny, and already loaded in our app.
(** I say might, because useElmish is simple enough to implement! )
Thanks again! Cheers.
from feliz.
Got it! Thanks much... sitcking to useElmish!
from feliz.
Related Issues (20)
- Elmish subscriptions does not work with Feliz.UseElmish
- Add jsx string template support to default template and to docs? HOT 1
- Feliz.Markdown plug-in support HOT 2
- Issue version 3.10.0 when using another Router component in the inner component
- IReactProperty Question HOT 1
- Q: interesting
- add vitest to template
- 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
- Clarification and Potential Improvement on PR #480 useEffectOnce behavior HOT 5
- Expanding Feliz.Rechart HOT 3
- Component created with a forwardRef that has generic type parameters loses state HOT 2
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.