manu.js manu.js - 1 year ago 134
React JSX Question

How to update a value in reactjs component from outside react

I am new to the technology reactjs. I would like to know how I can show a value from text input which is not rendered using react to a react component which is simply a label which shows that value. Any help would be immensely appreciated.

Thanks in advance..

Answer Source

Simply call the javascript from the React component. E.g.

const value = document.getElementById('text').value;

Here's a fiddle with it all working.

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