Material-table: Error when using Fragment for container

Created on 13 Aug 2019  路  3Comments  路  Source: mbrn/material-table

Describe the bug
Specifying React.fragment as Container component fails with error: Failed prop type: Invalid propcomponents.Containersupplied toMaterialTable.

To Reproduce

components={{ Container: React.Fragment }}

as per #119

Expected behavior
Table to be wrapped in nothingness.

Additional context
Add any other context about the problem here.

Regression introduced here: https://github.com/mbrn/material-table/commit/8e73b1f7b0e925116f4c1b905c232f752318da1a#diff-2d70362469a78d83972d4a85388d6e70R299

wontfix

Most helpful comment

Try:
components={{ Container: props => <Fragment>{props.children}</Fragment>, }}

All 3 comments

Try:
components={{ Container: props => <Fragment>{props.children}</Fragment>, }}

Will try tomorrow, but there鈥檚 an additional error about style being applied to React.Fragment, which isn鈥檛 allowed either.

Invalid prop `style` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

terapepo picture terapepo  路  3Comments

VipinJoshi picture VipinJoshi  路  3Comments

Mihier-Roy picture Mihier-Roy  路  3Comments

behrouz-s picture behrouz-s  路  3Comments

bohrsty picture bohrsty  路  3Comments