Has anyone tried to port DraftJs with React Native. Any ideas how to do it?
Draft.js and React Native
Asked Answered
Ask the chat room? github.com/facebook/draft-js/blob/master/… –
Milfordmilhaud
As the link showing, It's a hard work to implement a complete new native version editor with current draft model. Some hard points are I can see:
- Keyboard and cursor control.
editable content
did much help for it in Draft.editable content
is already supported by browsers. - Draft model is composed with blocks and inline-things. It's match the HTML model, making map Draft model to DOM easily. But iOS/Android layout not composed with block and inline-things.
- H5 has flex and powerful style control. You can use all CSS styles in Draft with the help of style mappers, leaving the render work to browsers. But how it work in native? Android/iOS SDK not provide such powerful style control to the views.
After all, Draft is announced as a Editor Framework
, not a ready to use editor. It's OK to limit your editor functions and have a native version, but I'd rather to embed a WebView to have a really powerful H5 Editor.
© 2022 - 2024 — McMap. All rights reserved.