HarryChen0506 / react-markdown-editor-lite

a light-weight Markdown editor based on React. 一款轻量的基于React的markdown编辑器
https://harrychen0506.github.io/react-markdown-editor-lite/
MIT License
1.03k stars 160 forks source link

Feature request: allow default view prop on initial render #143

Open code-angels opened 4 years ago

code-angels commented 4 years ago

Hi, great library and thanks for the support.

Would it be possible to allow a prop to render the default view?
The use case I have is that I want to render the 'text editor view only' on mobile by default.
I think that this makes sense as the side-by-side view on mobile isn't very attractive nor practical.

This may theoretically be achieved by writing a plugin and re-writing most of the logic in: https://github.com/HarryChen0506/react-markdown-editor-lite/blob/master/src/plugins/modeToggle.tsx

But personally I think that this is too much duplication and hassle fo functionality that the library already provides and does well.

sylingd commented 4 years ago

Use config.view