Skip to content

Cannot assign to read only property 'width' of object '#<Object>' icon #75

@prostgles

Description

@prostgles

If size is specified together with a read only style the component breaks.

The code bellow will produce this error: Cannot assign to read only property 'width' of object '#<Object>' icon

App.tsx

const fixedStyle = { color: "red" } as const;

export function SomeComponent(){
  return <Icon path={mdiCheck} style={fixedStyle} size={1} />
}

This issue seems to be triggered by mutating the style object in Icon.tsx L31

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions