2017-09-16 52 views
0

我試圖在閱讀的文檔,使用反應,選擇成分(https://github.com/JedWatson/react-select)並混淆了這句話,見下圖:React-Select,如何包含樣式css文件?

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

當我輸入的陣營JSX文件這一行,我現在用的是選擇組件我收到以下錯誤:

...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'" 
}, 
{ 
.... 
} 

有人可以提供關於此問題的一些提示嗎?

回答

1

它看起來像我找到了這個問題的答案。

基本上我所做的是我手動將css文件從node_modules/react-select/dist/react-select.css複製到我的rails項目中的/ assets/javascript/stylesheets文件夾中。

欲瞭解更多信息,請看:https://stackoverflow.com/a/10291177/5761338

相關問題