I'am working on a react Js project and i have a problem.
I try to call a function from the back (which works well) but it does not read my function and does not display the prints of my function.
There is: my function:
const getEvents = async() => {
console.log("PLZ")
const test = await getAllEvents();
console.log(test)
}
export const Calendar = () => {
return (
<StyledCalendar>
{console.log("AHHHHHHH")}
{getEvents}
</StyledCalendar>
)}
I shortened the return to make it easier to read.
and there is my calls function:
export const getAllEvents = async() =>
await axios.post(`${SERVER_URL}/calendar/getAllEvent `, {
});
It doesn't print(the console.log(PLZ)), but it print the console.log(AHHHHHHH) Thanks for yours answers!