I would like to use Johnny-Five and create an interface with React JS.
I used this React setup tutorial. I installed Johnny-Five in the same project: http://johnny-five.io/ (Johnny-Five works very well alone, in standalone apps. This allows me to control my Arduino).
My React index.js:
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import MainRouter from './routes';
import registerServiceWorker from './registerServiceWorker';
import five from 'johnny-five';
var board = new five.Board({
port: "/dev/ttyACM0"
});
board.on("ready", function() {
var led = new five.Led(13);
led.blink(500);
});
ReactDOM.render( <MainRouter />, document.getElementById('root'))
registerServiceWorker();
When I run React, the site starts but the board does not react! While the same code without React works perfectly well. Any idea to make Johnny-Five work with React?