⃝ A react null renderer

Last update: Apr 18, 2022

There are legitimate usecases for null-components, or logical components. A component has a lifecycle, local state, packs side-effects into useEffect, memoizes calculations in useMemo, orchestrates async ops with suspense, communicates via context, maintains fast response with concurrency. And of course — the entire React eco system is available.

Build Status Version

Nothing to see here ...

Quite so. This package allows you to bring Reacts high-level component abstraction to Node, or wherever you need it. Why not manage your REST endpoints like routes on the client, users as components with mount/unmount lifecycles, self-contained separation of concern and clean side-effects. Suspense for requests, etc.

You can try a small demo here: https://codesandbox.io/s/react-nil-mvpry

How does it work?

import React, { useState, useEffect } from "react"
import { render } from "react-nil"

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 />)

GitHub

https://github.com/pmndrs/react-nil
You might also like...

a react renderer for the command line

This repository is now archived This project was originally created as an alternative to the Ink library, as a separate renderer for a real React comp

Dec 2, 2020

🦍• [Work in Progress] React Renderer to build UI interfaces using canvas/WebGL

🦍• [Work in Progress] React Renderer to build UI interfaces using canvas/WebGL

React Ape React Ape is a react renderer to build UI interfaces using canvas/WebGL. React Ape was built to be an optional React-TV renderer. It's mainl

May 12, 2022

📟 A React Renderer for SSD1306 OLED chip on Raspberry Pi.

📟 A React Renderer for SSD1306 OLED chip on Raspberry Pi.

React SSD1306 A React Renderer for SSD1306 OLED chip on Raspberry Pi For those who doesn't have the device, a canvas-based web emulator is also includ

Apr 19, 2022

React renderer with X11 as a target

React renderer with X11 as a target

react-x11 React custom rendering where side effects are communication with X11 server. The goal is to create a simple library where you would apply yo

Apr 26, 2022

React renderer for building user interfaces in Unity UI

React Unity React Unity is a way to build interactive UI in Unity3D using React. It can be used together with packages like Typescript, redux, i18next

May 16, 2022

A custom Slack renderer for React! 3

react-slack-renderer Render Slack messages in a cool (React) way. const message = SlackRenderer.render( SlackMessage SlackText Heyo

Jun 22, 2021

🦴 A barebones react renderer for ogl.

react-ogl Declaratively create scenes with re-usable OGL components that have their own state and effects and can tap into React's infinite ecosystem.

Apr 25, 2022

React Fiber Reconciler Renderer for Regl WebGL

react-regl This library enables Regl shader WebGL draw commands to be rendered directly as React components. Demos View demos in the Storybook There i

Apr 13, 2022

Connect, discover, be free to choose between WebGL / Canvas (PIXI) / DOM or any other UI renderer

Connect, discover, be free to choose between WebGL / Canvas (PIXI) / DOM or any other UI renderer

React Liberty Be free to choose between WebGL / Canvas / DOM / Native or any other UI renderer This is a React library designed to abstract renderer b

Sep 10, 2021
Comments
  • 1. what's the difference between react-nil and this

    what's the difference between react-nil and this:

    import React from 'react'
    import ReactDOM from 'react-dom'
    
    function UseFriendStatus(friendID) {
      console.log('21212121')
      return null
    }
    
    ReactDOM.render(<UseFriendStatus />, document.getElementById('root'))
    

    return null is a valid case

    Reviewed by azl397985856 at 2020-09-16 02:35
  • 2. chore(deps): add scheduler as dev dependency

    Issue: #6.

    react-reconciler requires scheduler to be installed alongside it. Users shouldn't be burdened with internal dependencies, so I thought we can include it here.

    Reviewed by CodyJasonBennett at 2021-06-26 10:47
  • 3. Scheduler dependency?

    Hi Poimandres,

    Love this. Really creative thinking IMHO. Just taking it for a spin.

    I had to "npm i scheduler" to get it to work with node / parcel because scheduler wasn't found in react-nil/node_modules.

    My bad?

    Howard

    Reviewed by tebb at 2020-10-06 00:09
  • 4. Return data ?

    This is more a question than an issue. (sorry for that)

    Are those "components" should not return data? Or should react-nil provide a new type of "components" that return data (object, array,...) instead of return null.

    Just an idea.

    Reviewed by tony-go at 2020-09-17 07:17
React JSX Renderer is a React Component for rendering JSX to React nodes.

React JSX Renderer A React Component for Rendering JSX. Description React JSX Renderer is a React Component for rendering JSX to React nodes.

Jan 9, 2022
🇨🇭 A React renderer for Three.js (web and react-native)
🇨🇭 A React renderer for Three.js (web and react-native)

react-three-fiber react-three-fiber is a React renderer for threejs on the web and react-native. npm install three react-three-fiber These demos are r

May 15, 2022
🇨🇭 A React renderer for Three.js (web and react-native)
🇨🇭 A React renderer for Three.js (web and react-native)

react-three-fiber react-three-fiber is a React renderer for threejs on the web and react-native. npm install three react-three-fiber These demos are r

May 19, 2022
[ Unmaintained due to raphamorim/react-ape ] React Renderer for low memory applications
[ Unmaintained due to raphamorim/react-ape ] React Renderer for low memory applications

React-TV · react-tv: React Renderer for low memory applications. react-tv-cli: React Packager for TVs. Currently under development. import React from

May 10, 2022
⚛️ A React renderer for Figma
⚛️ A React renderer for Figma

React Figma A React renderer for Figma. Use React components as a source for your designs. ?? Compatible with react-native, react-sketchapp, react-pri

May 10, 2022
A React renderer for Hardware.

React Hardware React Hardware enables you to build firmata-based hardware applications using a consistent developer experience based on JavaScript and

May 4, 2022
A react renderer for browser's dev console
A react renderer for browser's dev console

Konsul is an abstraction of the browser's console that comes with a React renderer. It offers text styling, images, style inheritance, buttons with cl

Jan 3, 2022
React custom renderer for Appcelerator® Titanium™ SDK
React custom renderer for Appcelerator® Titanium™ SDK

⚠️ Maintainer wanted! Create an issue if you want to maintain it! react-titanium A React custom renderer for Appcelerator® Titanium™ SDK. This rendere

Mar 6, 2022
React renderer for NativeScript
React renderer for NativeScript

React NativeScript is A React renderer for NativeScript, allowing you to write a NativeScript app using the familiar React style. I'm always hanging o

Apr 21, 2022
A react renderer for blessed.

react-blessed A React custom renderer for the blessed library. This renderer should currently be considered as experimental, is subject to change and

May 17, 2022