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

Page becomes unresponsive when using multiple custom stitches components #1129

Open
upendra-web opened this issue Dec 20, 2022 · 0 comments
Open

Comments

@upendra-web
Copy link

upendra-web commented Dec 20, 2022

Bug report

Describe the bug

I created a sandbox with React + Typescript + Stitches. I created some basic components like Box and Text with stitches, something like below

const BaseBox = styled("div", {
  // Some variants
});

type BoxProps = ComponentProps<typeof BaseBox> & { testID?: string };

function Box(props: BoxProps) {
  const { testID, ...restProps } = props;
  return <BaseBox {...restProps} data-testid={testID} />;
}
const BaseText = styled(BaseBox, {
  // Some variants
});

type TextProps = ComponentProps<typeof BaseText> & { testID?: string };

function Text(props: TextProps) {
  const { testID, ...restProps } = props;
  return <Text {...restProps} data-testid={testID} />;
}

When I am using the above components my page is freezing and no UI is rendered

To Reproduce

Steps to reproduce the behavior:

  1. Go to the sandbox
  2. After the Codesandbox UI loading is complete, the preview section still appears blank

Steps to see the preview section

  1. Remove stitches components usage in App.tsx
  2. Create a simpler UI with div and span
  3. Now you should see the preview

Expected behavior

When using stitches components should not freeze my page.

Screenshots

Firefox
image

System information

  • OS: Ubuntu
  • Browser: Chrome - 108.0.5359.124, Firefox - 108.0.1
  • Version of Stitches: 1.2.8
  • Version of Node.js: 14.18.2

Additional context

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

1 participant