-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Problem
When withOnyx is used multiple times while composing components, it adds overhead to what Onyx has to keep track of and also prevents optimizations like batched render updates from working to their full potential.
Solution
Create a custom ESLint in https://github.com/Expensify/eslint-config-expensify/tree/main/eslint-plugin-expensify which detects when withOnyx() is used multiple times in the same file, and throws an error. The error should give instructions on the best practices which is something like:
Only use withOnyx() once. If there are dependent Onyx keys, they can all be handled in a single instance of withOnyx through the use of selectors.
That should also link to the Onyx readme, and I'm going to write a specific section in there about the best practice that we can link to.
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01f185d4f92edd4f6c
- Upwork Job ID: 1702383017796775936
- Last Price Increase: 2023-09-14
- Automatic offers:
- mollfpr | Reviewer | 26743007
- studentofcoding | Contributor | 26743012