Invalid hook call. Hooks can only be called inside of the body of a function component
hello, i got this error
Invalid hook call. Hooks can only be called inside of the body of a function component
the function is called by a click event on a button
const doExternalCall = () => {
const apiUrl = useApiUrl();
console.log( apiUrl );
const { data: customData, isLoading: customIsLoading } = useCustom<PostUniqueCheckResponse>({
url:
method: "get",
/*
config: {
headers: {
"x-custom-header": "foo-bar",
},
query: {
title: "Foo bar",
},
},
*/
});
console.log( customData );
};
what's wrong?
Invalid hook call. Hooks can only be called inside of the body of a function component
the function is called by a click event on a button
const doExternalCall = () => {
const apiUrl = useApiUrl();
console.log( apiUrl );
const { data: customData, isLoading: customIsLoading } = useCustom<PostUniqueCheckResponse>({
url:
${apiUrl}/strapi-chat,method: "get",
/*
config: {
headers: {
"x-custom-header": "foo-bar",
},
query: {
title: "Foo bar",
},
},
*/
});
console.log( customData );
};
what's wrong?
