Convert class components to functional components in the API docs examples #4254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
name: 📖 New/Updated Documentation Content
about: Adding a new docs page, or updating content in an existing docs page
PR Type
Does this PR add a new page, or update an existing page?
Checklist
What docs page is being added or updated?
For Updating Existing Content
What updates should be made to the page?
The class-based react components should be converted to functional components.
Do these updates change any of the assumptions or target audience? If so, how do they change?
Converting the components to functional components assumes the audience understands the basics of functional react components and hooks. In contrast, the existing examples assume the audience understands the lifecycle methods of class components. Both of these concepts are foundational to modern React development. Still, functions and hooks seem to be the preferred method of defining a component (e.g., the React docs have mainly been rewritten to use functional components: https://reactjs.org/docs/lists-and-keys.html).