I have a problem that works as follows, I have a function that it has to be executed within userEffect once, but userEffect always executes twice and I don't know why, I've looked here for many solutions and they all give the same answer which is to use the useEffect parameter so with this [] or use useCallback, but none of the methods worked and I even tested it with something very simple, I'll put the code here.
import React from 'react';
function App() {
React.useEffect(() => {
test();
},[])
function test (){
console.log('test')
}
return (
<div>
Hello
</div>
);
}
export default App;