Ant Design V5 - Props Changed Migration

This codemod changes the way the component props are applied.

Estimated time saving
Up to 1 minutes/occurrence
Change mode
Applicability criteria

Ant Design >= 5.0.0

Made by
Ant Design
Ant Design

Usage →

Codemod CLI:

intuita antd/5/props-changed-migration
copy CLI command icon

Codemod VS Code extension:

vs code logo
Run in VS Code

Description

This codemod changes the way the component props are applied.

Before

import { Tag } from 'antd';
const Component = () => {
  const [visible, setVisible] = useState(false);

  return <Tag visible={visible} />;
};

After

import { Tag } from 'antd';
const Component = () => {
  const [visible, setVisible] = useState(false);

  return (visible ? <Tag /> : null);
};