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

Display skeleton before render #674

Open
haaarshsingh opened this issue Jul 21, 2024 · 3 comments
Open

Display skeleton before render #674

haaarshsingh opened this issue Jul 21, 2024 · 3 comments

Comments

@haaarshsingh
Copy link

I'm having a bunch of layout shift because this editor renders in after the rest of my components. How can I know if it has loaded or not so I can display a skeleton or something?

@jaywcjlove
Copy link
Member

@harshhhdev Do you need an effect like this? I think this requires implementation on your part.

<Skeleton loading={loading}>
     <CodeMirror value={goLang} height="200px" extensions={[StreamLanguage.define(go)]} />
</Skeleton>

@haaarshsingh
Copy link
Author

@jaywcjlove yessir, exactly like that. How should I go about making the loading implementation myself though? 🤔

@jaywcjlove
Copy link
Member

Do I need to add a componentDidMount prop?

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