This repository contains a few example of common React patterns, where I tried to simplify their usage. The goal was to understand when each pattern can be used to help me write better code.
Inspired on:
- @kentcdodds advanced react patterns examples
- @Vitaminvp react patterns
- React Patterns
Proudly using:
- React@18
- Vite@4
- Bun (to replace NodeJS)
- Typescript
- TailwindCSS
- SASS preprocessor
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptionsproperty like this:
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},- Replace
plugin:@typescript-eslint/recommendedtoplugin:@typescript-eslint/recommended-type-checkedorplugin:@typescript-eslint/strict-type-checked - Optionally add
plugin:@typescript-eslint/stylistic-type-checked - Install eslint-plugin-react and add
plugin:react/recommended&plugin:react/jsx-runtimeto theextendslist