Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing styled-components <Input /> into Select throws warning #9736

Closed
1 task done
donovanhiland opened this issue Jan 4, 2018 · 1 comment
Closed
1 task done
Assignees
Labels
docs Improvements or additions to the documentation

Comments

@donovanhiland
Copy link

I'm trying to pass an Input component styled with styled-components into select and getting the warning:
Material-UI: you have provided an invalid value to the inputproperty., We expect an element instance of theInput component.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

I should be able to pass an Input styled with styled components to Select

const StyledInput = styled(Input)
<Select input={<StyledInput />} />

Current Behavior

Throws warning:

warning(
  isMuiElement(input, ['Input']),
  [
    'Material-UI: you have provided an invalid value to the `input` property.',
    'We expect an element instance of the `Input` component.',
  ].join('\n'),
);

Steps to Reproduce (for bugs)

https://codesandbox.io/s/4qql0opo0w

Context

I'm trying to compose some custom mui elements

Your Environment

Tech Version
Material-UI 1.0.0-beta.26
React 16.2.0
StyledComponents 2.2.4
browser 63.0.3239.84
@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Jan 4, 2018
@oliviertassinari
Copy link
Member

You are missing this line StyledInput.muiName = 'Input'.
https://codesandbox.io/s/q7nlk7r3pq.

We need to improve the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

No branches or pull requests

2 participants