dyne / zenroom-react

a playground to test zenroom in react app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zenroom in React playground

This project was bootstrapped with Create React App.

Getting started

Following this guide: https://www.dyne.org/using-zenroom-with-javascript-react-part3/

Clone the repo

git clone https://github.com/ivanminutillo/zenroom-react.git

Install dependencies

yarn install

Quick & dirty hack to use .wasm in react

cd public
ln -s ../node_modules/zenroom/dist/lib/zenroom.wasm .

open the node_modules/zenroom/dist/lib/zenroom.js file and change from this

var wasmBinaryFile = 'zenroom.wasm';
if (!isDataURI(wasmBinaryFile)) {
  wasmBinaryFile = locateFile(wasmBinaryFile);
}

to this

var wasmBinaryFile = '/zenroom.wasm';
if (!isDataURI(wasmBinaryFile)) {
  // wasmBinaryFile = locateFile(wasmBinaryFile);
}

Launch the app

yarn start

Open the browser console and check the zenroom output

(zencode script is located on app.js)

About

a playground to test zenroom in react app


Languages

Language:JavaScript 80.8%Language:HTML 10.3%Language:CSS 9.0%