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

Overriding core components styles #546

Closed
asaf opened this issue Apr 15, 2017 · 4 comments · Fixed by #547
Closed

Overriding core components styles #546

asaf opened this issue Apr 15, 2017 · 4 comments · Fixed by #547

Comments

@asaf
Copy link
Contributor

asaf commented Apr 15, 2017

Hey,

I'd like to perform minimal changes on the core widgets shipped with this package,
For example, I'd like to extend all components with my some CSS classes:

import React, {PropTypes} from "react"
import _BaseInput from 'react-jsonschema-form/lib/components/widgets/BaseInput'

function BaseInput(props) {
    return <_BaseInput {...props} className='foo'/>
}
export default BaseInput

This won't work because BaseInput overrides the className field,

Do you find it okay to move the inputProps at the end of the list so default props could be overriden ?

Also, other components that don't inherit from BaseInput don't propagate properties, if you find this approach acceptable I can send some PR that make the core widgets extendable.

Thanks.

@n1k0
Copy link
Collaborator

n1k0 commented Apr 15, 2017

Yeah that sounds reasonnable. Please send a PR 👍

asaf added a commit to asaf/react-jsonschema-form that referenced this issue Apr 15, 2017
Make it possible to extends the BaseInput widget and override some of its
props (e.g., "className")

resolves rjsf-team#546
@developer-lindner
Copy link

developer-lindner commented Apr 21, 2017

@n1k0 What about removing the bootstrap dependency and implement something like decorators? so anyone could define the wrapping div's + classes they need for their chosen framework. Or implement a decorator plugin for the specific framework (bootstrap, foundation, whatsoever). Just my 2 cents...

glasserc pushed a commit that referenced this issue Apr 21, 2017
Make it possible to extends the BaseInput widget and override some of its
props (e.g., "className")

resolves #546
eeinowski pushed a commit to eeinowski/react-jsonschema-form that referenced this issue May 23, 2017
Make it possible to extends the BaseInput widget and override some of its
props (e.g., "className")

resolves rjsf-team#546
@mravenash
Copy link

is there a sandbox for this? It will be helpful.

@epicfaace
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants