React Null Renderer

A custom React renderer that only renders null literally.

Install & Import:

import { render } from “react-nil”

Basic usage:

function Foo() {
  const [active, set] = useState(false)
  useEffect(() => void setInterval(() => set((a) => !a), 1000), [])
  console.log(active)
  // This is a logical component without a view, it renders nothing,
  // but it has a real lifecycle and is managed by React regardless.
  return null
}
render(<Foo />)

Preview:

React Null Renderer

Download Details:

Author: react-spring

Live Demo: View The Demo

Download Link: Download The Source Code

Official Website: https://github.com/react-spring/react-nil

License: MIT

Add Comment