What are the possible return types of render method?
Below are the list of following types used and return from render method,
React elements: Elements that instruct React to render a DOM node. It includes html elements such as <div/> and user defined elements.
Arrays and fragments: Return multiple elements to render as Arrays and Fragments to wrap multiple elements
Portals: Render children into a different DOM subtree.
String and numbers: Render both Strings and Numbers as text nodes in the DOM
Booleans or null: Doesn’t render anything but these types are used to conditionally render content.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.
We use cookies to ensure that we give you the best experience and use cookies in order to personalize the advertising that you see on our website. Read more about our Privacy Policy.Got it!