简体   繁体   English

尝试导入错误:“Typography”未从“antd”导出

[英]Attempted import error: 'Typography' is not exported from 'antd'

Antd failing to compile on specific Typographies and compiling perfectly on the others. Antd 无法在特定的排版上编译并在其他字体上完美编译。

This is the list of what I have included on my antd-react project:这是我在 antd-react 项目中包含的内容列表:

import {
  Input,
  Col,
  Row,
  Select,
  InputNumber,
  AutoComplete,
  Cascader,
  Option,
  Menu,
  Icon,
  Popover,
  Button,
  Form,
  Checkbox,
  InputGroup,
  DatePicker
} from "antd";

In this case, every Typography works expect Option which fails to compile.在这种情况下,每个 Typography 都希望Option无法编译。

I have already tried re-installing the package.json file.我已经尝试重新安装package.json文件。

There is no such component Option if you mean Select.Option in this case you need to:如果您的意思是Select.Option ,则没有这样的组件Option在这种情况下,您需要:

import { Select } from 'antd';

const { Option } = Select;

Use the search bar to look for Option and you will notice it refers to Select .使用搜索栏查找Option ,您会注意到它指的是Select

You can check all the available components on the left sidebar.您可以在左侧边栏中检查所有可用组件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试导入错误:'未从 - Attempted import error:' is not exported from 导入错误:“图标”未从“antd”导出 - import error: 'Icon' is not exported from 'antd' 尝试导入错误:“ApiRequests”未从“./ApiRequests”导出 - Attempted import error: 'ApiRequests' is not exported from './ApiRequests' 尝试导入错误:“必需”未从“是的”导出 - Attempted import error : 'required' is not exported from 'yup' 尝试导入错误:“App”未从“./App”导出 - Attempted import error: 'App' is not exported from './App' 尝试导入错误:“getMoviesList”未从“./actions”导出; 反应错误 redux - Attempted import error: 'getMoviesList' is not exported from './actions'; error in react redux 反应错误“尝试导入错误:'TodoItem'未从'./Todoitem'导出。” - error in react " Attempted import error: 'TodoItem' is not exported from './Todoitem'. " 尝试导入错误:未从“ d3”导出“行为” - Attempted import error: 'behavior' is not exported from 'd3' 尝试导入错误:“app”未从“firebase/app”导出(导入为“firebase”) - Attempted import error: 'app' is not exported from 'firebase/app' (imported as 'firebase') 尝试导入错误:“Navigate”未从“react-router-dom”导出 - Attempted import error: 'Navigate' is not exported from 'react-router-dom'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM