im not sure if has been asked before or has encountered same issue on reactjs. scenario this, have index.html file includes javascript. on react component, have condition render if condition true. means when page loaded component has not been rendered yet. when toggle button component gets rendered. child component needs call javascript method included on index.html. how should this?
any appreciated.
in index.html
<script type="text/javascript"> function test(){ alert('function index.html'); } </script>
in component
componentwillmount: function(){ window.test(); }
Comments
Post a Comment