This project was bootstrapped with Create React App.
- You need yarn! To install dependencies and work on the project make sure you have yarn installed and set up.
- This is a TypeScript project, please make sure to type all your variables and don't use
any
. - The code style here is governed by prettier and is enforced via a pre commit hook, that formats your code when committing. Look up you editor integrations here.
- This project uses eslint to catch common mistakes, look up how to enable reporting of the results in your editor.
- We are using the
@reach/router
to handle navigation in the app, check their documentation to get familiar. - Please make yourself familiar with writing tests and supply them in your code if you want to get it merged. There's some good starting points here.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Formats all the staged code with prettier
.
Make sure that the code you want to format is staged on git before running.
Runs eslint
on source and test files.
Runs prettier
to check for code style violations.
Runs prettier
to fix code style.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
The project uses Material-UI's styling solution for components (see the documentation).
For example, a functional component can be styled using hooks:
import React from 'react';
import { makeStyles } from '@material-ui/core';
const useStyles = makeStyles({
root: { 'font-weight': 'bold' },
});
const Example: React.FC = () => {
const classes = useStyles();
return <div className={classes.root}>Hello world!</div>;
};
export default Example;
Locales are defined in src/locales/en.json like this:
{
"helloworld": "Hello world!"
}
Using translations:
import React from 'react';
import { useTranslation } from 'react-i18next';
const Example: React.FC = () => {
const { t } = useTranslation();
return <div>{t('helloworld')}</div>;
};
export default Example;
Also see the react-18next documentation.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.