In the React component below, I want to fetch data from the server and then present it in component html, the data is arriving and i can see in the console.lo, but the component wont be rendering it.
- Why the data is not shown in the html even though
console.log
shows the data? - Is this the case for
signal
?createSignal
?useSignal
?
export const ManagementUsersList = () => {
const list = signal([]);
effect(() => {
client()
.get('/user')
.then(({ data }) => {
console.log(data);
list.value = data;
});
});
return (
<div>
{JSON.stringify(list.value)}
</div>
);
};