3 ms·
Compared to React, what isn't available in Preact?
by holic 11y ago
Compared to React, what isn't available in Preact?
- Sheepsteak 11y agoLast time I checked you couldn't use contexts yet.
- terrortrain 11y agoThats a good thing. Context is not a good feature, and even the developers didn't want to write documentation for it because they didn't want people to use it. https://github.com/facebook/react/issues/580 https://github.com/facebook/react/issues/580
- zbyte64 11y agoThen how would something like react-redux work without context?
- acjohnson55 11y agoAs people adopt external state containers, like Flux and Redux, it becomes increasingly impractical to bucket brigade chunks of data and callbacks to the leaves of the component tree via props. Some sort of delivery mechanism that doesn't couple in intermediate components is pretty critical to avoid having to maintain an unbounded amount of glue code. Context isn't without its kinks, but it's pretty useful in cutting boilerplate and decoupling components. The one thing I don't buy is that it's somehow worse than props from an architectural perspective (it's often compared to global variables, which makes little sense to me).