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

const [ layout ] = useJustifiedLayout( ... ) caused infinite rerender loop #1

Open
yelnyafacee opened this issue Dec 12, 2022 · 1 comment

Comments

@yelnyafacee
Copy link

Hi, I tried using this package:

  // Declare & Set Layout Config
  const layoutConfig2 = {
    containerPadding: 0,
    containerWidth: containerWidth,
    boxSpacing: {
      horizontal: 10,
      vertical: 10
    },
    // forceAspectRatio: 1
  };

  const [ layout ] = useJustifiedLayout({
      layoutInput: JSON.parse(props.imageSizesJSON),
      configuration: layoutConfig2,
      dependencies: []
  })


  console.log('useJustifiedLayout > layout: ' + JSON.stringify(layout, null, 2));

and it is causing infinite re-render loop

@alanmoraales
Copy link
Owner

alanmoraales commented Feb 3, 2023

Hey @yelnyafacee were you able to find the problem? I think it's because of the JSON.parse(). I'm sorry about not noticing your issue before.

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