search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

1 answers
Q&A javascript - How to configure babel-plugin-import using antdesign?
javascript - How to configure babel-plugin-import using antdesign?
世界只因有你 2017-07-04 13:44:15 Views 2062
Git

0

1. This is the file in the folder

2. Configuration in package.json

3. Use npm install to load the files in node_modules

4. Running entry code (npm run dev starts the service)

5. Browser error message (visit: localhost:8000/index.html)


index.html

Questions:
1. Note: must use https://github.com/ant-design... .
For more information, please see https://github.com/ant-design. ..
How to solve this error?

2. arning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). Check the render method of WingBlankExample.
What is the reason for this error? How should we deal with it?
Please give me the answer, thank you very much.

Your Answer
submit

1 answers
0

1. Configure babelrc or add babel-loader in webpack

// .babelrc or babel-loader option
{
  "plugins": [
    ["import", { libraryName: "antd", style: "css" }] // `style: true` 会加载 less 文件
  ]
}

2. Component reference error: Do not add < /> to components defined using functions

ReactDom.render(WingBlankExample, document.body);
2017-07-04 13:46:15

submit

Popular tool

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use