Open xamsuka opened 2 years ago
I have the same issue. The hook basically works at the beginning when the component renders. It logs this:
LOG {"value": ""}
And then nothing is updated.
Any update on this? These hooks don't seem to work. Can't seem to find a good example either. I just need a hook where I can get the current chart data or price. Thanks!
As of 9/27/22, none of the hooks work. This would be a very helpful feature, and it's advertised in the docs as being usable. Would the author/maintainers be able to take a look? My package versions:
"react-native": "0.69.4",
"react-native-gesture-handler": "~2.5.0",
"react-native-wagmi-charts": "~2.1.0",
any update on this guys ?
@mxs Same issue here, hooks are not refreshing with data is changed. Any fix?
Hi guys, looking into this one, it appears that the hooks are updating just fine on my end. Since these are shared values, they don't automatically trigger updates to react components.
If you run this hook for example
useAnimatedReaction(() => price.formatted.value,
() => {
console.log(price.formatted.value);
});
you will see the values are indeed updating.
To confirm as well, are your components lower in the hierarchy than the relevant chart provider, eg. <LineChart.Provider>
?
The hooks need to access the relevant contexts for their data.
Line chart hooks not working (LineChart.useChart, LineChart.usePrice). Hook works once, then the data ceases to be updated. If you use components instead of hooks, then everything works. I tried downgrading the library.