App.js (460B)
1 import React, { Component } from 'react'; 2 import I from "immutable" 3 4 class App extends Component { 5 componentDidMount() { 6 this.fields = new I.Map({a:2}) 7 } 8 9 onClick = () => { 10 const f = this.fields 11 console.log(f) 12 } 13 14 render() { 15 return ( 16 <div className="App"> 17 <button onClick={this.onClick}>Click Me</button> 18 </div> 19 ); 20 } 21 } 22 23 window.clickButton = () => document.querySelector("button").click() 24 25 export default App;