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

how to import a chakra-ui component in mdx? #90

Open
nshen opened this issue Sep 2, 2021 · 2 comments
Open

how to import a chakra-ui component in mdx? #90

nshen opened this issue Sep 2, 2021 · 2 comments

Comments

@nshen
Copy link

nshen commented Sep 2, 2021

hi, I modify the Demo component by just import a Chakra-ui Button , and it didn't work any more , anyone know what should I do to import a component?

Server Error
TypeError: F.__spreadArray is not a function

Demo.tsx

import { Button } from '@chakra-ui/react';
import * as React from 'react';

function Demo() {
  return (
    <div>
      Neat demo!{' '}
      <Button
        onClick={() => {
          console.log(111);
        }}
      >
        sdfsdf
      </Button>
    </div>
  );
}

export default Demo;
@Arcath
Copy link
Collaborator

Arcath commented Sep 12, 2021

I would suggest for UI components etc... that they should be provided as a global so that any styles are in your app and no the bundle.

@nshen
Copy link
Author

nshen commented Sep 12, 2021

I would suggest for UI components etc... that they should be provided as a global so that any styles are in your app and no the bundle.

Can i make the whole chakra framework as a global ? i tried but didn't work?

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