how to use attribute name including colon in jsx

Viewed 514

I want to use attribute name including colon(:) in JSX.

ex)

<div sa:name='timer'></div>

I know react can't use a colon in the attribute name.

how is it possible to use that attribute name?

please help me :)

1 Answers

you an try this

const props = {} 
props ["sa:name"] = "timer";
<div props={props}></div>

now you can access props["sa:name"] in your children component.

Related