[material-ui][Box] Box throws an error when there is a RSC (React Server Component) as a child
@siriwatknp is already working on this.
Since Nov 20, 2023.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Steps to reproduce 🕹
Link to live example: https://codesandbox.io/p/devbox/fragrant-forest-gn5rr6?file=%2Fsrc%2Fapp%2Fpage.tsx%3A1%2C1
import { Box } from '@mui/material'
async function FooBar() {
return <Box>foobar</Box>
}
export default function Page() {
return (
<Box>
<FooBar />
</Box>
)
}
Current behavior 😯
Throws the following error:
app-index.js:32 Warning: Failed prop type: Invalid prop
childrensupplied toForwardRef(Box), expected a ReactNode.
Expected behavior 🤔
Not error =D
Context 🔦
Absolutely love MUI, but this is preventing us from using it in server components
Your environment 🌎
System:
OS: macOS 13.6
Binaries:
Node: 18.17.0 - ~/.nodenv/versions/18.17.0/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.6.7 - ~/.nodenv/versions/18.17.0/bin/npm
Browsers:
Chrome: 119.0.6045.159
Edge: Not Found
Safari: 16.6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.