最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - react-widget component not being properly rendered - Stack Overflow

programmeradmin1浏览0评论

I'm trying to use the react-widget and I'm facing the following issue:

Expected:

See the default ReactWidget ponent.

Actual:

The ponent does not load the styles.

It can be reproduced here:

I've tried different lib versions for react and react-widget and the result was the same. I'm missing something? Do I need to define at the DropdownList the itemComponent prop or by default it should give me the expected result?

I'm trying to use the react-widget and I'm facing the following issue:

Expected:

See the default ReactWidget ponent.

Actual:

The ponent does not load the styles.

It can be reproduced here:

I've tried different lib versions for react and react-widget and the result was the same. I'm missing something? Do I need to define at the DropdownList the itemComponent prop or by default it should give me the expected result?

Share Improve this question asked Jul 31, 2018 at 15:50 Edmar BarrosEdmar Barros 331 silver badge5 bronze badges 1
  • Keep in mind CodeSandbox is very tedious when doing imports into style files. So if you add the import "react-widgets/dist/css/react-widgets.css"; to the style.css file it might not work in the CodeSandbox editor. But from experience using react-widgets, yes you do need to include the css in your styles file. – Xavid Ramirez Commented Jul 31, 2018 at 16:07
Add a ment  | 

2 Answers 2

Reset to default 6

You have to import the CSS that es with the react-widget library to give it its styling.

import "react-widgets/dist/css/react-widgets.css";

Import the stylesheet like this:

import "react-widgets/styles.css";
发布评论

评论列表(0)

  1. 暂无评论