Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draft.js and React Native

Has anyone tried to port DraftJs with React Native. Any ideas how to do it?

https://github.com/facebook/draft-js/issues/138

like image 887
John Paul Manoza Avatar asked Jul 28 '16 03:07

John Paul Manoza


1 Answers

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:

  1. Keyboard and cursor control. editable content did much help for it in Draft. editable content is already supported by browsers.
  2. 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.
  3. 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.

like image 55
Jiang YD Avatar answered Oct 13 '22 05:10

Jiang YD