Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prism.effect() warning spam when using useVal #501

Open
ivoilic opened this issue Nov 18, 2024 · 2 comments
Open

prism.effect() warning spam when using useVal #501

ivoilic opened this issue Nov 18, 2024 · 2 comments

Comments

@ivoilic
Copy link

ivoilic commented Nov 18, 2024

I've got a really basic setup with theater in react and I'm using useVal function to get some values from a sheet. My console is full of the warning: "prism.effect() does not run in cold prisms Error Component Stack" that seems to be coming from theuseVal.

As someone who is not using the dataverse package explicitly, having this warning about something internal to the hook coming from that package is confusing.

If there is an issue with my usage of the hook I'd love to know and happy to contribute to the docs, if this is something internal that I can ignore it would be great to get the warning silenced.

@AriaMinaei
Copy link
Member

Can you post the snippet where you use useVal() in?

@ivoilic
Copy link
Author

ivoilic commented Nov 20, 2024

This is from inside a react component, it seems to be happening whenever the react state changes. This component is receiving a theater project as a prop since my use case requires dynamically generating a new project for every instance of a component. I'm not sure if the useMemo's are needed but the warning appears either way. Thanks for responding so quickly!

  const sheet = useMemo(() => theaterProject.sheet('test'), [theaterProject]);
  const sheetConfig = useMemo(
    () =>
      sheet.object<SectionConfig>('Config', {
        ...initialConfig,
      }),
    [sheet, initialConfig],
  );

  const config = useVal(sheetConfig.props);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants