Common
The place to create local components that are common in the app project.
How to use
If you are going to create a global component that applies only to the project then you can use this method.
Step 1: Set up component
The first step you have to create a component folder in ./src/components/common. With the file structure as below.

Step 2: Component code
index.js used to place the root function component in which there are props and rendering elements. Here we use override button component with Qasir UI or Material UI. You can also create pure components that you want without overriding other component design systems.
Step 3: Component style
style.js used to style the component. Here we use one of the function styles from Material UI, namely makeStyles.
Step 4: Import component
We use aliases for component usage, code as shown below. You can check aliases configs in jsconfig.json
Last updated