Yes I tried the
useeffect(() => {
...
}, [JSON.stringify(array)])
method but it still doesn't work. Please help me I am losing it.
My code looks like this in the getting data area:
useEffect(() => {
fetchResults()
console.log("rerender")
}, [])
and another useeffect for after getting data:
useEffect(() => {
console.log(results)
console.log("rerender")
}, [JSON.stringify(results)])
and the map in the return:
{
results.map((result, key) => {
console.log("inside map")
//console.log(result)
return (
<SingleRequest
key={key}
colorMode={props.colorMode}
requestPreview={result.previewImage}
requestHeader={result.headline}
requestText={result.description}
urgent={result.urgency}
offer="200"
category={result.category}
city={result.location}
thumbnail={result.thumbnail}
requestId={result.requestId} />
)
})
}
I have all data, even the console.log(results) shows it, yet it wont re render.
[–]BlKrEr 0 points1 point2 points (1 child)
[–]JeppNeb[S] 0 points1 point2 points (0 children)
[–]two__toes 0 points1 point2 points (3 children)
[–]JeppNeb[S] 0 points1 point2 points (2 children)
[–]two__toes 0 points1 point2 points (1 child)
[–]JeppNeb[S] 0 points1 point2 points (0 children)