export const FunctionalDumbComponent = (props) => (
<div>{props.title}</div>
);
- Functional Param Component
- Hook Component
- Class Component
- HOC
Install dependencies
npm install react-router-dom
npm install @types/react-router-dom
Index.tsx
import { HashRouter as Router } from "react-router-dom";
render(
<Router>
<App />
</Router>,
document.getElementById("root")
);
App.tsx
<Switch>
<Route exact path="/">
<Home />
</Route>
<Route exact path="/about">
<About />
</Route>
<Route render={() => <div>Miss</div>} />
</Switch>
npm install i18next
npm install react-i18next
npm install i18next-xhr-backend
npm install i18next-browser-languagedetector
- create folder "public" in root
- create folder "locales" inside "public"
- create folders for each locale - i.e. "en"
- create file "translation.json" for each locale
// ...
plugins: [
// ...
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, 'public'),
to: 'public'
},
]),
// ...
]
// ...
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO