React Render

Return React Element

render() {
  return <div>Example of return<div />
}

Return Another Component

render() {
  return <MyComponent />
}

Return String

render() {
  return 'Return a string works!'
}

Return Numbers (rendered as text node)

render() {
  return 100
}

Return nothing

render() {
  return null
}

Leave a Reply

Your email address will not be published. Required fields are marked *