GitXplorerGitXplorer
C

preact-reconciler

public
126 stars
3 forks
0 issues

Commits

List of commits on branch main.
Unverified
b661e98bfa550184ed0622cd230e1d5e3cecad63

v0.1.8

CCodyJasonBennett committed a year ago
Unverified
761c627db9254bb47fb711c94dc12f5b662d139b

v0.1.7

CCodyJasonBennett committed a year ago
Verified
e56bb40e86b72c6fb9577a6bd69181e3bf753ada

fix: splice null child (#2)

CCodyJasonBennett committed a year ago
Unverified
9e139ed2791dcdad8acbc37c3b74d5d4d6a7099c

chore(reflection): fix typo

CCodyJasonBennett committed 2 years ago
Unverified
b2488a534f2d990b8fbf2712ba9d1ae5af448d62

v0.1.6

CCodyJasonBennett committed 2 years ago
Unverified
2bcc82b84757c26bb8db8c2e2d581ca1d9f7e7e1

v0.1.5

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
  },
}