|
|
|
|
|
by tiglionabbit
2394 days ago
|
|
I've edited my comment. I've used HOCs to share behavior between React components in the past. You can also accomplish similar things with the Render Props pattern, depending on how you want to organize code. Using hooks is new to me. Anyway, my point is there has always been ways to factor out the behavior from React components. I'm pretty sure the reason they don't encourage factoring it out completely is so that DOM events are still handled in the domain of the UI, since they don't deal with types in your model. https://reactjs.org/docs/render-props.html |
|