2

.webpackrc.js, is it wrong?

When I import {Select} from antd the Select has no style, just antd-mobile style work.

entry: "src/index.js", 
theme: 'src/theme.js',
extraBabelPlugins: [[
  "import",
  {libraryName: "antd-mobile", 
  "libraryDirectory": "lib", "style":true}, 
  {libraryName: "antd",
  "libraryDirectory": "lib", "style": true} 
]],
Triyugi Narayan Mani
  • 3,039
  • 8
  • 36
  • 56
xiane
  • 33
  • 1
  • 5

2 Answers2

0

make sure you wrote the right component Select,beginning with a capital letter. or try another component to see if the same?

Wellen zhong
  • 96
  • 1
  • 5
0

Try importing the css manually by adding

import 'antd/dist/antd.css'; or import 'antd/dist/antd.less'

Source: https://ant.design/docs/react/introduce

Ole Nor
  • 135
  • 8