-
Notifications
You must be signed in to change notification settings - Fork 333
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
fix: style prop no longer passed to React.Fragment #601
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
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 c9418a1:
|
@@ -93,6 +92,13 @@ export const Sandpack: SandpackInternal = (props) => { | |||
height: props.options?.editorHeight, // use the original editor height | |||
}; | |||
|
|||
const RightColumn: React.FC<{ children: React.ReactNode }> = ({ children }) => |
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.
Hummm... I'm afraid that this will remount everything and its children on every render.
What about conditionally passing the props to the RightColumn
? Something like this:
const rightColumnProps = useMemo(() => hasRightColumn ? { style } : {}, [hasRightColumn])
<RightColumn {...rightColumnProps}>
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.
Wow yep, I wasn't thinking, haha. Updated 👍
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.
Thank you! No more warnings on tests!
What kind of change does this pull request introduce?
Bug fix
What is the current behavior?
Currently getting this error when using Sandpack React:
I traced back the error back to this point in the code.
What is the new behavior?
Don't apply the
style
prop toReact.Fragment
What steps did you take to test this? This is required before we can merge, make sure to test the flow you've updated.
It seemed fine in CodeSandbox projects, but I have done no more testing. Please check everything works!