We are removing the Octicon component that is imported from @primer/react/deprecated in the next major release of this package. We would like to update usage of this component to use the icon directly from @primer/octicons-react instead.
This rule should do the following:
- Update usage like
<Octicon icon={XIcon} /> to be <XIcon /> and should remove the import to Octicons from @primer/react/deprecated
- Preserve additional props on the component, like
<Octicon {...rest} className="test" icon={XIcon} /> should map to <XIcon {...rest} className="test" />
- If there is logic in the
icon prop, like conditionally rendered, then it should preserve that condition when rendering the icons and correctly map props to each
- It should also support updating dynamic icon lookups, like
<Octicon icon={icon} />, by replacing the call to icon with the icon directly, like: <Icon />
We are removing the
Octiconcomponent that is imported from@primer/react/deprecatedin the next major release of this package. We would like to update usage of this component to use the icon directly from@primer/octicons-reactinstead.This rule should do the following:
<Octicon icon={XIcon} />to be<XIcon />and should remove the import toOcticonsfrom@primer/react/deprecated<Octicon {...rest} className="test" icon={XIcon} />should map to<XIcon {...rest} className="test" />iconprop, like conditionally rendered, then it should preserve that condition when rendering the icons and correctly map props to each<Octicon icon={icon} />, by replacing the call toiconwith the icon directly, like:<Icon />