mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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>
This commit is contained in:
parent
93a93b5031
commit
e55756066b
@ -15,6 +15,8 @@ Generally we follow the Airbnb [React Style Guide](https://github.com/airbnb/jav
|
|||||||
- [React](#react)
|
- [React](#react)
|
||||||
- [Props](#props)
|
- [Props](#props)
|
||||||
- [State management](#state-management)
|
- [State management](#state-management)
|
||||||
|
|
||||||
|
- [Proposal for removing or replacing Angular dependencies](https://github.com/grafana/grafana/pull/23048)
|
||||||
|
|
||||||
## Basic rules
|
## Basic rules
|
||||||
|
|
||||||
@ -324,6 +326,6 @@ static defaultProps: Partial<Props> = { ... }
|
|||||||
## State management
|
## State management
|
||||||
|
|
||||||
- Don't mutate state in reducers or thunks.
|
- 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 `reducerTester` to test reducers. See [Redux framework](redux.md) for more details.
|
||||||
- Use state selectors to access state instead of accessing state directly.
|
- Use state selectors to access state instead of accessing state directly.
|
||||||
|
Loading…
Reference in New Issue
Block a user