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
Allow different (styled) input components #15
Comments
I think this is a great idea so I've implemented it. There is now an optional In addition I've added helpers called export const StyledInput1 = styled.input`
background: purple;
color: orange;
`;
// elsewhere
return <TextInput component={StyledInput1} value={this.text} /> Or to cut down syntactic noise: const StyledInput2 = TextInputUsing(StyledInput1);
// elsewhere
return <StyledInput2 value={this.text} /> Of course you could do it all in one step: const StyledInput3 = TextInputUsing(styled.input`
background: purple;
color: orange;
`); As you'd expect, none of this is dependent on static-components - it just happens to fit nicely with it. |
Oh nice, thanks! I'll add that in last example, you could take advantage of the const StyledInput3 = styled(TextInput)`
background: purple;
color: orange;
`); |
That's cool, and it looks like |
(Sorry to overload you with issues)
One disadvantage of using the built-in
bidi-mobx
input components is that they always renderinput
or acheckbox
or aselect
, but I actually want to render a specific styled version of those elements. For example, we mostly usestyled-components
to control form styling, and we'd love forTextInput
to be able to render one of our styledInput
s.I realize the bidi-mobx components are pretty easy for users to re-write using their own styles and functionality, but it might be handy to allow them to render an arbitrary component:
The text was updated successfully, but these errors were encountered: