3 ms·
In the approach described in the blog post, you only need two use*: `useValues` and `useAction` to pull in values and actions from the data layer. Nothing else.
by mariusandra 5y ago
In the approach described in the blog post, you only need two use*: `useValues` and `useAction` to pull in values and actions from the data layer. Nothing else. No local state with `useState`, no `useEffect` or `useRef` or anything else for interacting with your data. So in effect React == two hooks and JSX.
- cutler 5y agoI was thinking more generally where idiomatic React makes use of the whole panoply of use* variants. React is unusable for me because of this. useForm alone has exploded recently into a proliferation of sub-variants then when you add useController into the mix it's game over.
- acemarke 5y agoIt seems like you're talking about the APIs for a specific library (React Hook Form) rather than React in general. Overall, hooks allow libraries to package custom behavior. The `useSelector` hook mentioned above is a React-Redux-specific API that manages subscribing to the store and re-rendering the component when the requested extracted state value changes. So, the "proliferation" you're talking about here is simply libraries and individuals building their own specific logic on top of React's primitives, in the same way that users build specific components on top of React's component primitives.
- cutler 5y agoIsn't React Hook Form ( https://react-hook-form.com/ https://react-hook-form.com/) from the React team?
- acemarke 5y agoNo. The React team doesn't work on _any_ official libraries except React itself. Brian Vaughn did create `react-virtualized` and `react-window`, but he maintains those separately from his status as a React team member. React Hook Form is from a community member named Bill-something, I think. Out of curiosity, what gave you the impression that RHF might be from the actual React team?