-
Notifications
You must be signed in to change notification settings - Fork 85
feat: make core react components easily accessible #104
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
Conversation
|
a2e0799
to
2ae790d
Compare
Deploying tutorialkit-demo-page with
|
Latest commit: |
78890e2
|
Status: | ✅ Deploy successful! |
Preview URL: | https://1bf8d7a7.tutorialkit-demo-page.pages.dev |
Branch Preview URL: | https://joan-react-components-minor.tutorialkit-demo-page.pages.dev |
@@ -176,13 +178,15 @@ export function CodeMirrorEditor({ | |||
}, [doc]); | |||
|
|||
return ( | |||
<div className="h-full relative"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved the responsability of setting the height to the caller. While working on an example where we wanted a fix height, this felt nicer than to wrap it in a div.
However, maybe in the majority of use cases, h-full
is preferred. So maybe we should default className
to h-full
? I'm not sure.
export * from './CodeMirrorEditor/index.js'; | ||
export * from './FileTree.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed those exports because they're not used at the moment and the intent is to have them imported via the /core
module.
…-minor-improvements
Deploying tutorialkit-docs-page with
|
Latest commit: |
97ab5ea
|
Status: | ✅ Deploy successful! |
Preview URL: | https://3361bdb6.tutorialkit-docs-page.pages.dev |
Branch Preview URL: | https://joan-react-components-minor.tutorialkit-docs-page.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts but otherwise it looks good to me.
This PR changes a bit the
@tutorialkit/react-components
so that theCodeMirrorEditor
,Terminal
andFileTree
can be easily accessed under a/core
module:Given that the
Terminal
component is not SSR friendly because of@xterm
, it is also possible to import the component individually, via/core/<component name>
and both default and named exports are provided:(in the astro integration we lazy import the terminal with a dynamic import and add a
<Suspense>
boundary to make it work)