Skip to content

Commit 3da20f8

Browse files
[EuiIcon] Correct isMounted logic (#6166)
* Correct EuiIcon's isMounted logic * changelog
1 parent 7d79e91 commit 3da20f8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/components/icon/icon.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export class EuiIconClass extends PureComponent<
133133
EuiIconProps & WithEuiThemeProps,
134134
State
135135
> {
136-
isMounted = true;
136+
isMounted = false;
137137
constructor(props: EuiIconProps & WithEuiThemeProps) {
138138
super(props);
139139

@@ -149,6 +149,7 @@ export class EuiIconClass extends PureComponent<
149149
}
150150

151151
componentDidMount() {
152+
this.isMounted = true;
152153
const { type } = this.props;
153154

154155
if (isEuiIconType(type) && this.state.icon == null) {

upcoming_changelogs/6166.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**Bug fixes**
2+
3+
- Fixed a bug in some development environments which prevented `EuiIcon` from loading icons asynchronously

0 commit comments

Comments
 (0)