Skip to content

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

Description

@donovanhiland

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

Metadata

Metadata

Labels

docsImprovements or additions to the documentation.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions