//USe.jsx file , this file export to App.jsx and run this file import React,{useState} from 'react'; const use=()=>{ const[store_age,update_age]=useState(19); const handle=()=>{ update_age(store_age+2); } return( <div className="main"> <h1>toadya ia am {store_age} old</h1> <button onClick={handle} > get oldder </button> </div> ) } export default use;
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter