Skip to content

Replace should with must to denote that Suspense is not optional with React.lazy #2768

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JamieDixon
Copy link
Contributor

@JamieDixon JamieDixon commented Feb 21, 2020

Sometimes there can be some confusion with the word "should" because it is often used to denote an optional operation.

In the case of React.lazy the component must be a descendent of <Suspense> or a custom alternative. This PR changes the word "should" to "must" and includes a comment about using either Suspense or an alternative.

See this StackOverflow question where the user assumed it to be optional because of the word "should": https://stackoverflow.com/questions/60342788/react-lazy-not-loading-any-components#60342841

@JamieDixon JamieDixon changed the title Replace should with must to denote that Suspense is not optional Replace should with must to denote that Suspense is not optional with React.lazy Feb 21, 2020
@reactjs-bot
Copy link

reactjs-bot commented Feb 21, 2020

Deploy preview for reactjs ready!

Built with commit 41a866d

https://deploy-preview-2768--reactjs.netlify.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants