Failed to set an indexed property on 'CSSStyleDeclaration': Index property setter is not supported

Bhumi Thakkar picture Bhumi Thakkar · Apr 26, 2019 · Viewed 19.5k times · Source

I am getting above error in my react project when chrome version is updated to 74 (latest version).

enter image description here

Answer

Yaroslav picture Yaroslav · Apr 26, 2019

I work with Angular libraries and some of them does not support inline styles now (for me it was ngx-avatar and it not working on Firefox and chrome: 74)

before:

<ngx-avatar style="border-radius="50%"></ngx-avatar>

after:

<ngx-avatar [style.border-radius]="'50%'"></ngx-avatar>

I think you can try the same for React.