2

I am trying to use the react-select component (https://github.com/JedWatson/react-select) and confused with this sentence while reading the documentation, see below:

Be sure to include styles at some point, probably during your bootstrapping
import 'react-select/dist/react-select.css';

When I import this line in the React JSX file where I am using the Select component I am getting the following error:

 ...node_modules/react-select/dist/react-select.css:8\n.Select 
    {\n^\nParseError: Unexpected token\n>",
    "traces": {
    "Application Trace": [
    {
      "id": 39,
    "trace": "app/views/layouts/application.html.erb:7:in 

 `_app_views_layouts_application_html_erb___377503645297909977_70313107001300'"
}
],
"Framework Trace": [
{
"id": 0,
"trace": "browserify-rails (3.3.0) lib/browserify-rails/browserify_processor.rb:220:in `run_browserify'"
},
{
"id": 1,
"trace": "browserify-rails (3.3.0) lib/browserify-rails/browserify_processor.rb:51:in `call'"
},
{
....
}

Can someone provide some hints on this issue?

1 Answer 1

2

It looks like I found an answer towards this question.

Basically what I did is I manually copy the css file from node_modules/react-select/dist/react-select.css into /assets/javascript/stylesheets folder in my rails project.

For more infomation please look into: https://stackoverflow.com/a/10291177/5761338

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.