Skip to content

tchayen/remini

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

remini

Mini React implementation made for fun and practice. Please do not use in production.

Example

import { useState, createElement as c, render } from "./lib";

const Counter = () => {
  const [count, setCount] = useState(0);

  return c(
    "div",
    {},
    c("div", {}, `Value: ${count}`),
    c("button", { onClick: () => setCount(count + 1) })
  );
};

render(c(Counter), document.getElementById("root"));

How to play with it?

/examples contains examples of small web apps wrote with the library.

/packages/remini is the main library. It contains test that can be run with yarn test.

Packages

  • babel-plugin – contains Babel plugin for transforming files to support fast refresh and the runtime that is used for refreshing components.

  • remini – main library.

  • vite-plugin – plugin for Vite to support fast refresh.

Might come later

  • Accepting style object as alternative to string prop
  • Updater version of setState
  • refs
  • Context API
  • <Fragment />
  • SSR
  • Fast refresh
  • key prop

Missing from React

  • Non-blocking rendering
  • Ref forwarding
  • Code splitting
  • Portals
  • Suspense
  • Server components

Useful reading

HMR

Actual implementations

Later

TODO

  • Fast refresh duplicates SVG nodes

About

Mini React implementation made for fun and practice. Please do not use in production.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published