render abstract method
Examines props and state and returns one of the following types:
- ReactElement (renders a single DOM
Element
) - Fragment (renders multiple elements)
- ReactPortal (renders children into a different DOM subtree)
String
/num
(renders text nodes in the DOM)bool
/null
(renders nothing)
This method is required for class components.
The function should be pure, meaning that it should not modify component state, it returns the same result each time it is invoked, and it does not directly interact with browser / DOM apis.
If you need to interact with the browser / DOM apis, perform your work in componentDidMount
or the other lifecycle methods instead. Keeping render
pure makes components easier to think about.
Implementation
@override
dynamic render();