Vite
Use the Vite plugin for automatic wrapping of observable reads in JSX.
Install
Section titled “Install”npm install -D @usels/vite-plugin-legend-memoConfiguration
Section titled “Configuration”import { defineConfig } from 'vite';import react from '@vitejs/plugin-react';import { autoWrap } from '@usels/vite-plugin-legend-memo';
export default defineConfig({ plugins: [ autoWrap(), react(), ],});- Place
autoWrap()beforereact(). - Use this path unless you have a Babel-first build pipeline.