-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
Description
When trying to use a custom component, one can trying passing a string or a whole component.
String
Does not seem to be a common pattern for passing a component
<Notifs CustomComponent={Snackbar} />
Problems
- Does not allow props to be passed
- Passes all props (warning will throw for unnecessary props):
Full Component
Seems to the common method of accepting a component as a prop used in Libraries like material-ui
like here. That way props can be passed and set within the component (like you are doing with key).
<Notifs CustomComponent={<Snackbar open message="some" />} />
Problems
- Throws invalid element type warning:
- Even after changing src to allow this, the
addComponentAsRefTo
is still thrown (might be due to npm-linking causing react version conflicts):