score:6

Accepted answer

change to this:

import { bootstraputils } from 'react-bootstrap/lib/utils';

score:0

bootstraputils is a named export and not a default therefore you need to use {} around it.

try using: import { bootstraputils } from 'react-bootstrap/lib/utils/bootstraputils';

score:4

you can do this as well:

    import react from "react";
    import button from 'react-bootstrap/lib/button';
    import bootstraputils from 'react-bootstrap/lib/utils/bootstraputils';

    bootstraputils.addstyle(button, 'custom');

    export default class mediaitembutton extends react.component {
        render() {
            var styles={
                "backgroundcolor" : "purple",
                "color"           : "white"
            };
            return (
                <div>
                    <button style={styles} bsstyle="primary">custom</button>
                </div>
            );
        }
    }

Related Query

More Query from same tag