Ant Design V5 - Props Changed Migration

This codemod changes the way the component props are applied.

Ant Design
jscodeshift
Estimated time saving
Up to 1 minutes/occurrence
Change mode
Assistive
Applicability criteria

Ant Design >= 5.0.0

Made by
Ant Design
Ant Design

Usage →

Codemod CLI:

intalling vs code extension tooltip icon
codemod antd/5/props-changed-migration
copy CLI command icon

Codemod VS Code extension:

intalling vs code extension tooltip icon
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);
};