A reactive component library for Preact / React (not production ready)
The @pago/reactive library is a reactive component model for React and Preact. It aims to provide automatic performance optimizations and a simple API to help developers achieve their goals. Based on the Vue Composition API, this library allows developers to avoid bugs, errors, and unnecessary ceremony caused by the Hooks API. However, it is still in its early stages and may cause pain and changes to the API. Therefore, it should not be used in production. Feedback and observations from experiments are welcomed.
To set up the @pago/reactive library for React or Preact, follow these steps:
Example code for setting up @pago/reactive with React:
// @jsxImportSource @pago/reactive
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(
<App />,
document.getElementById('root')
);
Example code for setting up @pago/reactive with Preact:
// @jsxImportSource @pago/reactive
import { h, render } from 'preact';
import App from './App';
render(
<App />,
document.getElementById('root')
);
The @pago/reactive library provides a reactive component model for React and Preact. It aims to simplify state management and improve performance by providing automatic optimizations. While still in early development, it shows promise but should not yet be used in production. Feedback and experimentation are encouraged to refine the API.