Just trying to get a basic example of react-tabs working. The styling seems to be missing. The example below is in code sandbox (look in 'Hello.js'), but I see exactly the same behavior after installing the package into my project via npm. What am I missing? Thanks!
Just trying to get a basic example of react-tabs working. The styling seems to be missing. The example below is in code sandbox (look in 'Hello.js'), but I see exactly the same behavior after installing the package into my project via npm. What am I missing? Thanks!
https://codesandbox.io/s/jzql1q6819
Share Improve this question asked Sep 7, 2017 at 21:06 dt1000dt1000 3,7426 gold badges47 silver badges66 bronze badges 2-
1
side note: you can collapse all of the separate import statements to react-tabs to
import { Tabs, TabList, Tab, TabPanel } from 'react-tabs';
– Rob M. Commented Sep 7, 2017 at 21:17 - good point, thanks – dt1000 Commented Sep 7, 2017 at 21:47
1 Answer
Reset to default 5From the docs at https://github./reactjs/react-tabs#styling
react-tabs does not include any style loading by default. Default stylesheets are provided and can be included in your application if desired.
You will have to import the styles yourself. I don't think Code Sandbox will let you import them directly from the NPM package, so you will have to use a CDN or other source.
Besides that, the tabs are working in your example. Clicking a list item reveals different content
Here is a fork of your example with the styles added: https://codesandbox.io/s/ym7l2zk4oj
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745107205a4611631.html
评论列表(0条)