0.1.0 • Published 4 years ago

react-wasm-dom0 v0.1.0

Weekly downloads
4
License
Apache-2.0/MIT
Repository
-
Last release
4 years ago

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