wasm-react

Quick Start

# https://github.com/lencx/create-mpl
# npm 6.x
npm init mpl@latest my-app --type wasm

# npm 7+, extra double-dash is needed:
npm init mpl@latest my-app -- --type wasm

Pre-Install

cargo install rsw wasm-pack

Step1: Install deps

yarn

Step2: Init rsw.toml

# yarn rsw -h
yarn rsw init

Step3: Generate rust crate

yarn rsw new rsw-hello

Step4: Edit rsw.toml

rsw doc

[[crates]]
#! npm package name
name = "rsw-hello"
#! ⚠️ Note: must be set to `true`
#! run `npm link`: `true` | `false`, default is `false`
link = true

Step5: Run dev

yarn dev

Step6: Deploy

yarn build