@426729/

OptimisticLowProgrammingtool

React

No description

fork
loading
Files
  • src
    • App.js
    • App.css
    • index.css
    • index.js
    • logo.svg
  • package.json

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.7742653425331913","path":"src/App.js","file":{"path":"src/App.js","content":{"asEncoding":{"base64":"aW1wb3J0IFJlYWN0LCB7IENvbXBvbmVudCB9IGZyb20gJ3JlYWN0JzsKaW1wb3J0IGxvZ28gZnJvbSAnLi9sb2dvLnN2Zyc7CmltcG9ydCAnLi9BcHAuY3NzJzsKCmNsYXNzIEFwcCBleHRlbmRzIENvbXBvbmVudCB7CiAgY29uc3RydWN0b3IocHJvcHMpewogICAgc3VwZXIocHJvcHMpOwogICAgdGhpcy5zdGF0ZT17CiAgICAgIHZlY3RvcjpbXQogICAgfQogIH0KICByZW5kZXIoKSB7CiAgICByZXR1cm4gKAogICAgICA8ZGl2IGNsYXNzTmFtZT0iQXBwIj4KICAgICAgICB7PFZlY3RvclNsaWRlciB1cGRhdGU9eyh2YWwpPT50aGlzLnVwZGF0ZVZhbChpLHZhbCl9IHZhbHVlPXt0aGlzLnN0YXRlLnZlY3RvcltpXX0vPn0KICAgICAgPC9kaXY+CiAgICApOwogIH0KfQpjbGFzcyBWZWN0b3JTbGlkZXIgZXh0ZW5kcyBDb21wb25lbnR7CiAgY29uc3RydWN0b3IocHJvcHMpewogICAgc3VwZXIocHJvcHMpOwogICAgdGhpcy5zdGF0ZT17CiAgICAgIHZhbHVlOnByb3BzLnN0YXJ0aW5nVmFsdWUKICAgIH0KICB9CiAgcmVuZGVyKCl7CiAgICByZXR1cm4gKAogICAgICA8aW5wdXQgdHlwZT0icmFuZ2UiIGlkPSJyYW5nZSIgbWluPSItMSIgbWF4PSIxIiBzdGVwPSIwLjAxIiB2YWx1ZT17dGhpcy5zdGF0ZS52YWx1ZX0gb25DaGFuZ2U9eyhldnQpPT57dGhpcy5wcm9wcy51cGRhdGUoZXZ0LnRhcmdldC52YWx1ZSk7dGhpcy5zZXRTdGF0ZSh7dmFsdWU6ZXZ0LnRhcmdldC52YWx1ZX0pfX0gLz4KICAgICkKICB9Cn0KCmV4cG9ydCBkZWZhdWx0IEFwcDsK"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';

class App extends Component {
  constructor(props){
    super(props);
    this.state={
      vector:[]
    }
  }
  render() {
    return (
      <div className="App">
        {<VectorSlider update={(val)=>this.updateVal(i,val)} value={this.state.vector[i]}/>}
      </div>
    );
  }
}
class VectorSlider extends Component{
  constructor(props){
    super(props);
    this.state={
      value:props.startingValue
    }
  }
  render(){
    return (
      <input type="range" id="range" min="-1" max="1" step="0.01" value={this.state.value} onChange={(evt)=>{this.props.update(evt.target.value);this.setState({value:evt.target.value})}} />
    )
  }
}

export default App;