chore: Update React development guidelines#1014
Conversation
This file is automatically synced from the `shared-configs` repository. Source: https://github.com/doist/shared-configs/blob/main/
There was a problem hiding this comment.
This automated update keeps our React development guidelines in sync with the latest shared configurations, ensuring consistent documentation and best practices across the codebase. While these improvements help maintain alignment with our standards, the section on Zustand middleware currently references an incorrect import path for the immer middleware that would result in a module resolution error.
|
|
||
| ```typescript | ||
| import { create } from 'zustand' | ||
| import { devtools, immer } from 'zustand/middleware' |
There was a problem hiding this comment.
[P2] Incorrect import path for Zustand immer middleware
The immer middleware is exported from zustand/middleware/immer, not zustand/middleware. The zustand/middleware entry point exports devtools, persist, subscribeWithSelector, combine, and redux, but not immer. This import would fail at build time with a module resolution error. Per the official Zustand docs, the correct imports are:
| import { devtools, immer } from 'zustand/middleware' | |
| import { devtools } from 'zustand/middleware' | |
| import { immer } from 'zustand/middleware/immer' |
This PR updates
docs/react-guidelineswith the latest version from theshared-configsrepository.Changes
This is an automated sync of the shared React development guidelines configuration.
Source
Doist/shared-configs/🤖 This PR was automatically created by the
shared-configssync workflow.