Browse Source

Added undefined to in the list of possible return types of render function (#5275)

Co-authored-by: Shanmughapriyan S <priyanshan03@gmail.com>
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
main
Kunal Tiwari 2 years ago
committed by GitHub
parent
commit
e50e5634cc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      content/docs/reference-react-component.md

2
content/docs/reference-react-component.md

@ -125,7 +125,7 @@ When called, it should examine `this.props` and `this.state` and return one of t
- **Arrays and fragments.** Let you return multiple elements from render. See the documentation on [fragments](/docs/fragments.html) for more details.
- **Portals**. Let you render children into a different DOM subtree. See the documentation on [portals](/docs/portals.html) for more details.
- **String and numbers.** These are rendered as text nodes in the DOM.
- **Booleans or `null`**. Render nothing. (Mostly exists to support `return test && <Child />` pattern, where `test` is boolean.)
- **Booleans or `null` or `undefined`**. Render nothing. (Mostly exists to support `return test && <Child />` pattern, where `test` is boolean).
The `render()` function should be pure, meaning that it does not modify component state, it returns the same result each time it's invoked, and it does not directly interact with the browser.

Loading…
Cancel
Save