I'm looking for methods of managing elements of contenteditable
as React components.
Exploring Facebook's source via React DevTools extension reveals that they wrote a contenteditable
comment editor that seems to be fully managed by React.
You can see in the components tree that updating the conteneditable
triggers updates to components tree that are children of contenteditable
.
Facebook just released Draft.js - https://facebook.github.io/draft-js/
update:
Facebook has released draft-js which is meant for building text editors with react.
https://github.com/facebook/draft-js
original answer which is now outdated:
Go ahead, there is nothing special for this.
here are some examples:
- https://github.com/lovasoa/react-contenteditable
- https://github.com/liamzebedee/reactjs-contenteditable/blob/master/ContentEditable.jsx
- https://stackoverflow.com/a/22678516/1536309