Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

StyleShit/not-react

Repository files navigation

Not-React

A straightforward & simple implementation of a React-like library.

Created for fun and learning purposes πŸ€·β€β™€οΈ

Demo:

You can see a live demo with all of the code here.

Usage:

Basically the same as React, either with or without JSX.

Without JSX:

import * as NotReactDOM from "not-react-dom";
import { createElement, useState } from "not-react";
const App = () => {
 const [count, setCount] = useState(0);
 return createElement(
 "div",
 { className: "app" },
 createElement("h1", {}, "Hello World!")
 );
};
NotReactDOM.render(createElement(App), document.getElementById("root"));

With JSX:

import NotReact from "not-react";
import * as NotReactDOM from "not-react-dom";
const App = () => {
 const [count, setCount] = useState(0);
 return (
 <div className="app">
 <h1>Hello World!</h1>
 </div>
 );
};
NotReactDOM.render(<App />, document.getElementById("root"));

Note

Same as React, in order to use JSX, you need to add the @babel/plugin-transform-react-jsx plugin to your Babel config.

The difference is that you'll need to set the pragma option to NotReact.createElement (see the .babelrc file), and import NotReact instead of React.

Available Hooks:

  • useState
  • useEffect
  • useRef
  • useMemo
  • useReducer
  • useCallback

About

A straightforward & simple implementation of a React-like library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /