ianstormtaylor / slate

A completely customizable framework for building rich text editors. (Currently in beta.)
http://slatejs.org
MIT License
30.02k stars 3.26k forks source link

set id in react component #3453

Open hanselke opened 4 years ago

hanselke commented 4 years ago

Do you want to request a feature or report a bug?

Allow <Slate id="editor />

What's the current behavior?

currently the react component is rendered without an id tag

What's the expected behavior?

allow passing id props to that sets the id

mpkelly commented 4 years ago

Hi @hanselke, the id should not be set here.<Slate/> doesn't map to a DOM element itself but is only a wrapping context. You should set the id on the Editable instead, like <Editable id="my-editor"/>.

If that solves your problem then please close this issue.

PangYiMing commented 3 years ago

Why not declare a div with id ,like<div id="" style={{...}}><Slate/></div>