I want add a custom attribute (for instance an attribute named "key") in an element using React but I only can add some keywords like "className", "style", etc...
My code right now is like this:
function TodoItem(props){
return React.createElement("div",{key:props.id,className:"todo-item"},
React.createElement("input",{type:"checkbox"},null),
React.createElement("p",null,props.text)
);
}
I can not add "key:props.id".
My objective would be to create something like this:
<div class="todo-item" key="<int>" data-reactid=".0.0"><input type="checkbox" data-reactid=".0.0.0"><p data-reactid=".0.0.$test">Take out trash</p></div>
Right now I do not know how to put the key="int" part