antd style does not work with antd-mobile style

782 Views Asked by At

.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} 
]],
2

There are 2 best solutions below

0
On

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

0
On

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