Skip to content

Conversation

@niktverd
Copy link
Contributor

No description provided.

@gravity-ui-bot
Copy link
Contributor

Preview is ready.


import Anchor from '../Anchor';

const testId = 'anc-hor';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'anchor'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

const Content: React.FC<{text: string; icon?: ImageProps}> = ({text, icon}) => (
<Fragment>
{icon && <Image className={b('icon')} {...icon} />}
{icon && typeof icon !== 'string' && <Image className={b('icon')} {...icon} />}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because a new version of typescript requires a destructed item to be an Object. Icon type is complex: one of its type could be a string. String cannot be destructed

@niktverd niktverd merged commit b3e826b into main Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants