Skip to content

redneckz/uni-jsx

Repository files navigation

@redneckz/uni-jsx

Unification layer between React, Preact and Vue3. Write React-like unified components and use everywhere without recompilation.

NPM Version Build Status Bundle size

React as well as Vue3 comes with Virtual DOM and JSX approaches. There are a few differences at the low level.

This nano-library negates the differences between them on JSX level. Making it possible to implement universal components that work without recompiling in both React and Vue3.

Also the following React-like core hooks are available for Vue3:

  • useState
  • useEffect
  • useLayoutEffect
  • useCallback
  • useMemo
  • useRef

Workspaces

How-to start demo

Install and build:

$ npm i # install deps
$ npm run build

React demo:

$ npm run start:react # http://localhost:8080

Vue demo:

$ npm run start:vue # http://localhost:8090

Next demo:

$ npm run start:next # http://localhost:8070

Nuxt demo:

$ npm run start:nuxt # http://localhost:8060

Preact demo:

$ npm run start:preact

How to use

Documentation

Limitations

Common limitations:

  • Events are streamed up as-is (avoid usage of normalized Event fields specific to React or Vue)

React specific limitations:

  • NO refs forwarding

License

MIT

About

Unification layer between React, Preact and Vue3. Write React-like unified components and use everywhere without recompilation.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published