newprint newprint - 1 year ago 165
React JSX Question

How to get the value of react component - AceEditor

I am facing the following issue while using

react component

I am using
as user input, after user enters code, he(she) presses the
button. (see the picture) How do I extract the text that users enters from
component ? enter image description here

Answer Source

You need to subscribe to the onChange event (explained in the docs) and store the value passed into the callback somewhere, perhaps in the component's state if the Run button is on the same page. Then, when user clicks the button just retrieve it via

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download