mirror of
https://github.com/Screenly/Anthias.git
synced 2025-12-23 22:38:05 -05:00
16 lines
549 B
Plaintext
16 lines
549 B
Plaintext
---
|
|
description:
|
|
globs:
|
|
alwaysApply: true
|
|
---
|
|
# React
|
|
|
|
- Make use of functional components instead of class-based components.
|
|
- Use `useState` for managing state instead of `this.state`.
|
|
- Use `useEffect` for managing side effects instead of `componentDidMount`,
|
|
`componentDidUpdate`, and `componentWillUnmount`.
|
|
- Do not explicitly import React from `react`, as it is already being taken care
|
|
of by the `new webpack.ProvidePlugin({ React: 'react' })` plugin in
|
|
`webpack.common.js`.
|
|
- Avoid props drilling by using Redux for state management.
|