fix: do not set a default id for Icon component

Description

Setting the `id` property in `Icon.defaultProps` to `newId('Icon')` makes every Icon that doesn't explicitly provide an id have an identical id property, since `newId('Icon')` gets eveluated at module load time. Duplicate `id`s are not valid HTML.

We are already invoking `newId('Icon')` inside the `Icon` component's render method if no id is provided, so we can safely set the `id` in `defaultProps` to `undefined` and let the default `id` get generated at render time.

*Testing instructions*
1. Without this patch: Render two or more `<Icon>` components on a page. Notice that they all have the same id (`'Span1'`).
2. Do the same with this patch. Notice that the `id`s are no longer identical.

*Reviewers*:

  • [ ] @pkulkark

  • [ ] edX

Status

Assignee

Unassigned

Reporter

Open Source Pull Request Bot

Labels

Contributor Name

Matjaz Gregoric

Repo

edx/paragon

Customer

Epic Link

None

OSCM Assignee

None

Priority

Unset
Configure