How do you call API on button click in React Native?

css’; function callApi() { alert(‘Button was pressed! ‘); } function App() { return ( <div className=”App”> <header className=”App-header”> <button onClick={callApi}>Call API</button> </header> </div> ); } export default App; This will give us a button that when pressed will show an alert saying Button was pressed! .

Sizin İçin Seçtik  How do I fetch post API in react?

Leave a Reply

Your email address will not be published. Required fields are marked *