all you need is line 13, I guess the syntax is correct but when I reload the page it's alerting 2 times without me clicking the button and then when I click it it doesn't do anything
import { useState } from 'react';
import './App.scss';
import { FullPage, Slide } from 'react-full-page';
import First from './First';
function App() {
const [count, setCount] = useState(0);
return (
<FullPage controls>
<Slide>
<h1>Inner slide content</h1>
<First name="Nairi" count={count} />
<button onClick={alert()} className="btn btn-dark">+</button>
{/* <button onClick={setCount(count - 1)} className="btn btn-dark">-</button> */}
</Slide>
<Slide>
<h1>Another slide content</h1>
</Slide>
</FullPage>
);
}
export default App;
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>