Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Classes and HOCs into Presentational Components and Functional Hooks #1489

Closed
tn3rb opened this issue Aug 8, 2019 · 1 comment
Closed

Comments

@tn3rb
Copy link
Member

tn3rb commented Aug 8, 2019

Issue Overview

Currently there is a huge issue with re-renders and loading time that is exacerbated by the large stacks of higher-order-components (HOCs) used to wrap regular components in order to provide props. Much of this hierarchy was laid out prior to the introduction of React Hooks, so the only way to provide most data was via props, where shared state needed to be "raised up" to the highest component in the hierarchy and then allowed to "trickle down". Coupled with overly complex model objects this caused a LOT of re-renders.

I have been working on extracting the logic currently in HOCs and moving that into custom hooks that can now be implemented exactly where they are needed instead of having to pass props down through multiple components. As well, I have been trying to separate our components into those that are primarily presentational (JSX) versus those that are functional and process/retrieve data.

@joshfeck
Copy link
Contributor

joshfeck commented Aug 9, 2019

Does part of this include refactoring to implement useDispatch and useSelect hooks in the TAM composition to eliminate multiple HOCs?

Was noted in https://github.com/eventespresso/event-espresso-core/projects/4#card-23222769

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants