Wener Site

million

约 1 分钟阅读
  • aidenybai/millionGitHubaidenybai/millionaidenybai/million · MIT · <4kb · The Virtual DOM Replacement for React · https://million.dev/blog/virtual-dom · Diff the data, not the DOM.笔记:million
    • MIT
    • <4kb
    • The Virtual DOM Replacement for React
  • million.dev/blog/virtual-dom
    • Diff the data, not the DOM.
    • 适用场景
      • 大量静态内容但,少部分动态内容
      • "Stable" UI trees - 不做结构性变化
      • 细粒度场景优化
bash
npx million@latest # 自动 init

vite

TypeScript
import million from 'million/compiler';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [million.vite({ auto: true }), react()],
});

nextjs

TypeScript
import million from 'million/compiler';

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
};

const millionConfig = {
  auto: true, // if you're using RSC: auto: { rsc: true },
};

export default million.next(nextConfig, millionConfig);

Rules

TypeScript
// Block 能被定义为变量

console.log(block(() => <div />)) // ❌ Wrong
export default block(() => <div />) // ❌ Wrong

// 👇👇👇

const Block = block(() => <div />) // ✅ Correct

关联信息

反向链接和本文引用的外部资料。

反向链接

  • React Awesome
    笔记 · aidenybai/million

    专门功能选择专业组件 - Headless 配合 UI 组件达到更为理想的结果 · react-table · react-hook-form · floatingui · 选择样式与组件独立的 UI 库 · tailwindcss+daisyui

References

GitHub

1 条

其他外链

4 条
最近更新commit ff9f085Edit

On this page