Skip to content

[material-ui][Box] Box throws an error when there is a RSC (React Server Component) as a child #39928

Open
@mr-rpl

Description

@mr-rpl

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 children supplied to ForwardRef(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

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions