Skip to content

Commit

Permalink
docs: remove todo
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiVandivier committed Oct 21, 2024
1 parent 68f170c commit 19ba4ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/migration/v12.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ In terms of the React 18-related changes, upgrading to `@dhis2/cli-app-scripts`

### Default props

The main change in React 18 that is expected to affect apps at runtime is that using `MyComponent.defaultProps = { ... }` is deprecated [todo: just for functional components?], and will be removed in the next version. While non-breaking, this change comes along with warning messages in the console for every rendered component that uses them, which can be chatty and annoying.
The main change in React 18 that is expected to affect apps at runtime is that using `MyComponent.defaultProps = { ... }` is deprecated, and will be removed in the next major version. While non-breaking, this change comes along with warning messages in the console for every rendered component that uses them, which can be chatty and annoying.

The fix is to move prop defaults -- either to default parameters for functional components, or to a static property for class components. This code mod can help with the migration, and was used for the `@dhis2/ui` library: [transform.js](https://gist.github.com/kabaros/45ed16660ac89dc48d22e03836b1e981)

Expand Down

0 comments on commit 19ba4ab

Please sign in to comment.