Last active
February 27, 2023 17:05
-
-
Save arnoldc/fc0ad2a3474a9ea24c87b4e6c19e5771 to your computer and use it in GitHub Desktop.
[React Native] Architecture Tips
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // pattern 1 - component structure | |
| index.tsx: The index file contains the business logic of the component such as data fetching, | |
| as well as the connection to the global application state. It only renders the following .view component. | |
| <component>.view.tsx: The view file contains the UI. It doesn’t hold its own state nor does it connect directly to the global application state. It only renders the props it gets from the index file. | |
| <component>.styles.tsx: The styles file contains the React Native StyleSheet or the styled-components, depending on which approach you chose. | |
| <component>.types.tsx: The types file provides the data type for props and the state of the index and view files. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment