Skip to content

Update question #104 answer #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2611,26 +2611,42 @@ You can download the PDF and Epub version of this repository from the latest run

104. ### Is it possible to use React without rendering HTML?

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

```jsx harmony
render() {
return false
}
```

```jsx harmony
render() {
return true
}
```

```jsx harmony
render() {
return null
}
```

React version >=16.0.0:

```jsx harmony
render() {
return []
}
```

```jsx harmony
render() {
return ""
}
```

React version >=16.2.0:

```jsx harmony
render() {
return <React.Fragment></React.Fragment>
Expand All @@ -2643,7 +2659,13 @@ You can download the PDF and Epub version of this repository from the latest run
}
```

Returning `undefined` won't work.
React version >=18.0.0:

```jsx harmony
render() {
return undefined
}
```

**[⬆ Back to Top](#table-of-contents)**

Expand Down