Skip to content

Unable to bind class property of svg elements #258

@joshuafcole

Description

@joshuafcole

The issue appears to be that setting an svg element's className property isn't supported (which I did not know!).

The correct solution is to set:

elem.className.baseVal = <VALUE>

Stack below:

Annotation.tsx:87 Uncaught TypeError: Cannot set property className of #<SVGElement> which has only a getter
    at Object.Callout._$effect._v$3 [as fn] (Annotation.tsx:87)
    at runComputation (index.js:508)
    at updateComputation (index.js:496)
    at createRenderEffect (index.js:188)
    at Annotation.tsx:87
    at Callout (Annotation.tsx:87)
    at index.js:1182
    at untrack (index.js:281)
    at createComponent (index.js:1182)
    at Layouts.tsx:97

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtypescriptrelating to typescript or types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions