-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Adding custom bsStyle property to button component #537
Comments
There is no code in your post
It seems you need to wrap your code snippets into As for your question, I looks like this #306 A possible solution is not accepted yet #496 At the meantime you can check it and give some feedback if it helps to solve your problem. |
@AlexKVal Thanks. Yeah, I missed the markdown for my code. The original question has been updated now. I guess I need to add the custom bsStyle property by using the following snippet.
or add empty bsStyle=" " and then use the custom style using className I will try it out and let you know. Thanks for the support :) |
var constants = require('react-bootstrap/lib/constants');
constants.STYLES.custom = 'facebook'; this would be a @trevorr is working on that problem and he has created PR #496 as possible solution. $ git clone -b issue-440 https://github.com/trevorr/react-bootstrap.git trevorr_rb
$ cd trevorr_rb
$ npm install
$ npm link
$ cd .../your_project_dir/
$ npm link react-bootstrap As a result you will get special version of After that you can use this fixed package in your code like this import styleMaps from '../src/styleMaps';
...
styleMaps.addStyle('wacky');
<Button bsStyle='wacky'> In case you dare to try this |
I am using react-bootstrap for my project and I am trying to add custom bsStyle property to the button component. If I use the default bootstrap classes according to the following link http://react-bootstrap.github.io/components.html#buttons the class name is rendered properly. However, if I change the property to bsStyle='facebook' it renders btn-undefined
So in short, react-bootstrap only accepts default bootstrap classes (default, promary, success, etc) for bsStyle property.
This is my HTML looks like
and if I change my code to
it works fine and the class is rendered properly.
This is the console html log when I use custom bsStyle prop.
The text was updated successfully, but these errors were encountered: