GitXplorerGitXplorer
C

preact-reconciler

public
126 stars
3 forks
0 issues

Commits

List of commits on branch main.
Unverified
e33795ebb5828851f1bd376442395d7c1527553c

chore: cleanup

CCodyJasonBennett committed 2 years ago
Unverified
1520a62a9aacf89af4a711c14f6956bb1addeff3

chore: update demo

CCodyJasonBennett committed 2 years ago
Unverified
1439388896f347936cc440eddcb4844f4f06afbc

chore: harden container traverse

CCodyJasonBennett committed 2 years ago
Unverified
495a1a6c9400b562af869d7225ffca47afbfc6e4

perf: better minify methods

CCodyJasonBennett committed 2 years ago
Unverified
de2f3f58a550617354bef6f7ee21c8181a12381d

chore(tests): harden lifecycle

CCodyJasonBennett committed 2 years ago
Unverified
d21424804b72e70e7d21247713ad51540a85728d

chore(tests): cleanup

CCodyJasonBennett committed 2 years ago

README

The README file for this repository.

Size Version Downloads

preact-reconciler

Custom renderers for Preact in <1KB.

This package implements react-reconciler which allows for custom renderers to be implemented and shared between Preact and React such as @react-three/fiber.

import { render } from 'preact'
import { Canvas } from '@react-three/fiber'
import { OrbitControls } from '@react-three/drei'

// This is the same as ReactDOM.createRoot(root).render(...) with preact/compat
render(
  <Canvas>
    <OrbitControls />
    <mesh>
      <boxGeometry />
      <meshNormalMaterial />
    </mesh>
  </Canvas>,
  root,
)

Installation

To get started, you'll only need preact and preact-reconciler. No need to install react or react-dom.

npm install preact preact-reconciler
yarn add preact preact-reconciler
pnpm add preact preact-reconciler

With your choice of tooling, alias react, react-dom, and its dependencies.

const resolve = {
  alias: {
    react: 'preact/compat',
    'react-dom': 'preact/compat',
    'react-reconciler': 'preact-reconciler',
  },
}

// vite.config.js
export default { resolve }

// webpack.config.js
module.exports = { resolve }

// next.config.js (webpackFinal for .storybook/main.js)
module.exports = {
  webpack(config) {
    Object.assign(config.resolve.alias, resolve.alias)
    return config
  },
}