Attempted import error: 'Typography' is not exported from 'antd'

Viewed 1867

Antd failing to compile on specific Typographies and compiling perfectly on the others.

This is the list of what I have included on my antd-react project:

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.

I have already tried re-installing the package.json file.

1 Answers

There is no such component Option if you mean Select.Option in this case you need to:

import { Select } from 'antd';

const { Option } = Select;

Use the search bar to look for Option and you will notice it refers to Select.

You can check all the available components on the left sidebar.

Related