1

I am working on MERN.io project. I am using React.js component Dropdown.

But it doesn't contain its style and css and no-stying at all.

...
import Dropdown from 'react-dropdown';
import styles from './../../../../assets/css/style.css';

class OrderCreateWidget extends Component {
...
  render() {
...
    return(
      <div>
        <div className={styles["row"]}>
          <div className={styles["col-lg-12"]}>
            <div className={styles["card"]}>
              <div className={styles["card-header"]}>
                Place Order
              </div>
              <div className={styles["card-block"]}>
                <h5>*NOTICE* Please make sure that you have "Followers" enabled on your profile so that the share button appears for non-friends too, that will enable us to promote your post.</h5>
                <br/>
                <div className={styles["row"]}>
                  <div className={styles["col-lg-7"]}>
                    <div className={`${styles["row"]} ${styles["form-group"]}`}>
                      <label className={styles["col-md-3"]}>Service</label>
                        <Dropdown options={options} onChange={this._onSericeSelect} value='fb_likes1' placeholder="Select an option" />
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>         
    )

 ...
}

enter image description here

this is the screenshot how dropdown works, currently. I wishes great help from you. Thank you.

1 Answer 1

1
import 'react-dropdown/style.css';
Sign up to request clarification or add additional context in comments.

7 Comments

It works. But when I want to rebuild with webpack, it reports an error. /Volumes/Data/Projects/Rantic-Tyler/rantic_mern/client/modules/Order/components/OrderCreateWidget/OrderCreateWidget.js:1939 content.locals; ^ ReferenceError: content is not defined at Object.<anonymous> (/Volumes/Data/Projects/Rantic-Tyler/rantic_mern/client/modules/Order/components/OrderCreateWidget/OrderCreateWidget.js:11:1)
@KonstantinJ. more info please
I am using mern.io as a start project and I am including that css file in my component. But when I want to compile it, it reports an error like the above. I think it is because of webpack.
@KonstantinJ. can you share a config?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.