Skip to content

Commit

Permalink
Update function component notes
Browse files Browse the repository at this point in the history
  • Loading branch information
ecraig12345 authored Aug 31, 2020
1 parent 3aab760 commit feafb74
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions packages/react-next/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,22 @@ TODO: document any API or functionality changes
- Removed unused defaultProps from TeachingBubbleContent.
- Removed rootElementRef from public api.

### Function component conversions

- The `ref` prop for such components no longer refers to a component class instance; instead, the ref is forwarded to the underlying DOM.
- We will ensure all function components correctly return a reference to the root DOM element.
- For components with an imperative API, you can still access that via `componentRef`.
- See React's docs for [`useRef`](https://reactjs.org/docs/hooks-reference.html#useref) and [`forwardRef`](https://reactjs.org/docs/react-api.html#reactforwardref) for more on using refs with function components.
- The [deprecated `ReactDOM.findDOMNode` API](https://reactjs.org/docs/react-dom.html#finddomnode) can't be used to find root elements (this is a React limitation). Instead, use `ref` as described above.
- Class extension of most components is no longer supported.
- Due to time constraints, not all components will be converted by the time of v8 release. However, they may be converted at any time in the future within a minor version.
- Exception: Class extension of Pickers will continue to be supported for now since the current architecture relies on it. (This will change in a future major release, but not within v8.)
- Accessing `state` of converted components is no longer possible.
- If you need a former state property which is not included in the relevant `IComponentName` interface, please file an issue and we can consider adding it.
- In your components which use the converted components, you may need to wrap certain test operations in `act` from `react-dom/test-utils`. [More details here.](https://reactjs.org/docs/test-utils.html#act)

### Others

- Function component conversion.
- The `ref` attribute for such components no longer refers to a component class instance; instead, the ref is forwarded to the underlying DOM.
- Class extension of converted components is no longer possible.
- Even for components which have not yet been converted to function components, class extension is no longer supported
- `ThemeProvider` is required. (new)
- `KeytipData`/`keytipProps` removed from `Link`/`Toggle`/`Checkbox`.
- `Button` and `Card` are new components that break from their previous implementation.
Expand Down

0 comments on commit feafb74

Please sign in to comment.