Commit e5575606 by Hugo Häggmark Committed by GitHub

Docs: updates frontend style guides (#25391)

* Update frontend.md

* Update contribute/style-guides/frontend.md

Co-authored-by: Marcus Olsson <accounts+github@marcus.se.net>

Co-authored-by: Marcus Olsson <accounts+github@marcus.se.net>
parent 93a93b50
......@@ -16,6 +16,8 @@ Generally we follow the Airbnb [React Style Guide](https://github.com/airbnb/jav
- [Props](#props)
- [State management](#state-management)
- [Proposal for removing or replacing Angular dependencies](https://github.com/grafana/grafana/pull/23048)
## Basic rules
- Try to keep files small and focused.
......@@ -324,6 +326,6 @@ static defaultProps: Partial<Props> = { ... }
## State management
- Don't mutate state in reducers or thunks.
- Use helpers `actionCreatorFactory` and `reducerFactory` instead of traditional `switch statement` reducers in Redux. See [Redux framework](redux.md) for more details.
- Use `createSlice`. See [Redux Toolkit](https://redux-toolkit.js.org/) for more details.
- Use `reducerTester` to test reducers. See [Redux framework](redux.md) for more details.
- Use state selectors to access state instead of accessing state directly.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment