I have created an ASP.NET web Application(.NET framework) and have integrated React to it using ReactJS.NET package.
Now, when I try to use hooks in the functional components, it is not working. Can someone share any github sources or links where Hooks were used in ReactJS.NET project
I have added the project in Github. Link: https://github.com/naveengorojanam/ReactPOC
in the project, the path to the JSX file is ReactPOC/ReactPOC16/Scripts/JS/App.jsx
function App() {
//const [temp, setTemp] = React.useState("hello");
return (
<div>
<h1>React functional component</h1>
<button onClick={() => { window.alert('button clicked'); }}>click for alert</button>
</div>
)}
React.render(<App />, document.getElementById("reactdiv"));
I'm unable to run the temp hook from the App.jsx component. Please let me know where i went wrong
If I uncomment the line //const [temp, setTemp] = React.useState("hello");
, the project will not show any output