0 votes
in ReactJS by

Is it possible to use React without rendering HTML?

1 Answer

0 votes
by

It is possible with latest version (>=16.2). Below are the possible options:

render() {
  return false
}
render() {
  return null
}
render() {
  return []
}
render() {
  return <React.Fragment></React.Fragment>
}
render() {
  return <></>
}

Returning undefined won't work.

Related questions

0 votes
asked Jun 5, 2022 in Angular by Robindeniel
0 votes
asked Dec 14, 2023 in ReactJS by rahuljain1
0 votes
asked Apr 15, 2022 in ReactJS by Robindeniel
...