See Storybook for examples.
New components can be created from templates either by using the interactive prompt yarn new:component
or specifying the name and optional subdirectory yarn new:component --name SidecarUpload --dir item
.
This will create a folder containing a handful of new files and will export the component.
-
{ComponentName}.js
- The main component code plus PropTypes and MaterialUI styles.
-
{ComponentName}.stories.js
- A Storybook example.
-
{ComponentName}.test.js
- A basic test to check the component is mounted.
-
index.js
- The main export with the MaterialUI withStyles higher-order component.