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

Update components to use useMemo #43

Open
Edward-Upton opened this issue Sep 1, 2022 · 0 comments
Open

Update components to use useMemo #43

Edward-Upton opened this issue Sep 1, 2022 · 0 comments

Comments

@Edward-Upton
Copy link
Contributor

When we fetch data, for example, an array of elements, we often ensure that we were successful in the query. What this means is that when rendering we need to continuously check if the data exists, e.g:

{ elementsData?.getElements && {...}}

Instead, we can utilise useMemo to create a variable (e.g. elements) that is empty if a list or null otherwise which simplifies the rendering. We have already added this in some components and it seems to work well.

@Edward-Upton Edward-Upton added enhancement New feature or request low-priority labels Sep 1, 2022
@Edward-Upton Edward-Upton added this to To do in Fully Customizable Platform via automation Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low-priority
Development

No branches or pull requests

1 participant