How nextjs supports antd

using the nextjs framework, how to introduce antd, and load on demand.

Mar.17,2021

refer to https://github.com/zeit/next.


introduce antd-related files


the same question, have you solved


yarn add antd
yarn add babel-plugin-import
// .babelrc
{
  "presets": ["next/babel"],
  "plugins": [
    [
      "import",
      {
        "libraryName": "antd",
        "style": "css" // `style: true`  less 
      }
    ]
  ]
}
//
import { Button, Switch } from "antd";

<>
    <Button>Index page</Button>
    <Switch defaultChecked onChange={onChange} />
  </>
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31b4e-2bdbe.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31b4e-2bdbe.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?