Skip to content

Instantly share code, notes, and snippets.

@mrcthms
Created February 8, 2024 10:02
Show Gist options
  • Save mrcthms/80ef76821df6d871ca1f37987fbff0cf to your computer and use it in GitHub Desktop.
Save mrcthms/80ef76821df6d871ca1f37987fbff0cf to your computer and use it in GitHub Desktop.
function MyComponent() {
return null;
}
function MySettingsList() {
return (
<SettingsList action={{ content: 'Click me' }}>
<MyComponent />
</SettingsList>
)
}
@mrcthms
Copy link
Author

mrcthms commented Feb 8, 2024

MySettingsList here will render a dividing line before the action, as it assumes that MyComponent returns a truthy value and has no way of knowing whether it returns null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment