react-wasm-dom0
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

ReactWasmDOM

An experimental drop-in replacement for ReactDOM, written in Rust, compiled to WebAssembly.

Status

There are currently only plans to support renderToString, which is already half-functional. HTML markup should be generated (correctly), but no attributes will be rendered.

You can see a working SSR example right here.

Installation

npm install react-wasm-dom

Usage

Just replace renderToString from ReactDOM with the equivalent provided function.

import { renderToString } from "react-dom/server";

// ....

const markup = renderToString(<App />);

becomes

import("react-wasm-dom/server").then(({ renderToString }) => {
  // ....

  const markup = renderToString(<App />);
});

Caveats

  • Only modern module bundlers are supported. Otherwise the library won't load successfully under Node

Roadmap

  • Unit Tests
  • HTML attribute rendering

Readme

Keywords

none

Package Sidebar

Install

npm i react-wasm-dom0

Weekly Downloads

1

Version

0.1.0

License

Apache-2.0/MIT

Unpacked Size

259 kB

Total Files

11

Last publish

Collaborators

  • tarnadas