-
Notifications
You must be signed in to change notification settings - Fork 366
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
feat(react): react devtool #236
Conversation
@bvaughn, I've made some progress 😄 |
0d32ec5
to
5105312
Compare
Ooh this is exciting! Eager to see this when it's done! |
a0ba1b6
to
9d34c00
Compare
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 6e49c03:
|
9d34c00
to
aa51c06
Compare
@danilowoz Exciting to see so many updates! Let me know when it's ready for a test drive. |
## UnstyledOpenInCodeSandboxButton & OpenInCodeSandboxButton | ||
## ReactDevTools | ||
|
||
Sandpack also provides a component to add a plugin for React debugging, which allows you to inspect the React component hierarchies in the iframe. This is useful for `props` debugging and understanding the component tree. |
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.
Sandpack also provides a component to add a plugin for React debugging, which allows you to inspect the React component hierarchies in the iframe. This is useful for `props` debugging and understanding the component tree. | |
Sandpack also provides a component that adds React DevTools, allowing you to inspect the React component hierarchies in the iframe. This is useful for `props` debugging and understanding the component tree. Our `SandpackReactDevTools` component has the same functionality as the React DevTools brower extensions, but it only shows what is in your Sandpack instance. |
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'm not 100% sure if "instance" is the right word there at the end??)
sandpack-react/src/common/Layout.tsx
Outdated
}) => { | ||
const { sandpack } = useSandpack(); | ||
const c = useClasser("sp"); | ||
|
||
return ( | ||
<SandpackThemeProvider theme={theme}> | ||
<div ref={sandpack.lazyAnchorRef} className={c("layout")}> | ||
<div ref={sandpack.lazyAnchorRef} className={c("layout")} style={style}> |
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 didn't get why this was added? is there an instance of the Layout getting inline styles?
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 didn't find a way to override styles in the component level easily, so I realized it was not passing the style props down to the component. I think we could just spread all props into the component and not only explicit pass style
, it seems cleaver.
</SandpackLayout> | ||
</SandpackProvider> | ||
) | ||
}` |
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.
Looks like you forgot the "```" ticks for formatting here.
This introduces support for React debugging, which allows you to inspect the React component hierarchies in the iframe. This is useful for
props
debugging and understanding the component tree.Depends on codesandbox/codesandbox-client#6337