_mercury – 19-25 Aug 15

what could be wrong here ?
10 Replies
_mercury πŸ‡΅πŸ‡Έ
this route is working if i did it by a browser
const getAttributes = async () => {
const res = await fetch('/api/attributes');
console.log('res', res);

const attrs = await res.json();
console.log('d', attrs);
setAttributes(attrs);
};

useEffect(() => {
getAttributes();
}, []);
const getAttributes = async () => {
const res = await fetch('/api/attributes');
console.log('res', res);

const attrs = await res.json();
console.log('d', attrs);
setAttributes(attrs);
};

useEffect(() => {
getAttributes();
}, []);
Unknown User
Unknown Userβ€’3y ago
Message Not Public
Sign In & Join Server To View
_mercury πŸ‡΅πŸ‡Έ
console.log('res', res); not appear and method not called
Unknown User
Unknown Userβ€’3y ago
Message Not Public
Sign In & Join Server To View
_mercury πŸ‡΅πŸ‡Έ
I called it in useEffect ?
Unknown User
Unknown Userβ€’3y ago
Message Not Public
Sign In & Join Server To View
_mercury πŸ‡΅πŸ‡Έ
I have another Error in the code may be it stops react
Unknown User
Unknown Userβ€’3y ago
Message Not Public
Sign In & Join Server To View
_mercury πŸ‡΅πŸ‡Έ
yes i removed the comp that creates the erropr And i see it works thx
reactibot
reactibotβ€’3y ago
This thread hasn’t had any activity in 12 hours, so it’s now locked. Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1008818617971908608

Did you find this page helpful?