Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FED-3249 Update docs about migrator companion codemod #959

Merged
merged 3 commits into from
Oct 24, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions doc/null_safety/null_safe_migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ dart pub global run over_react_codemod:null_safety_migrator_companion --yes-to-a
```

This codemod will:
- Add nullability hints to props/state that are defaulted/initialized in class components.
greglittlefield-wf marked this conversation as resolved.
Show resolved Hide resolved
- Add nullability hints to state mixin/class fields
- These hints will cause defaulted/initialized values to be migrated as "late required".
greglittlefield-wf marked this conversation as resolved.
Show resolved Hide resolved
See our [prop requiredness and nullability](#prop-requiredness-and-nullability) docs for more details on whether you should keep them required following the migration.
- All non-initialized state fields will have optional nullable hints.
- Add nullable hints for callback ref types.
- Add annotations to disable required prop validation for `connect` props. See [`connect` required props migration case](#wrapper-and-connected-components-and-required-props) for more info.

#### Required props codemod

Expand Down Expand Up @@ -208,7 +211,7 @@ of the null safety and required props docs for instructions on how to handle the

For connect, either:
- Disable validation using the instructions linked above
- Note: for now, this must be done manually, but we'll be adding a codemod to help do this automatically for `connect`: https://github.com/Workiva/over_react_codemod/issues/295
- Note: The [null safety migrator companion codemod](#companion-codemod) does this automatically for all `connect` props.
- Refactor your component to instead utilize [OverReact Redux hooks](../over_react_redux_documentation.md#hooks),
which avoid this problem by accessing store data and dispatchers directly in the component as opposed to passing it in via props.

Expand Down