smartxworks / sunmao-ui

A Framework for Developing Low-code Tool
https://sunmao-ui.com
Apache License 2.0
1.38k stars 94 forks source link

Auto detect component's DOM element when component doesn't implement elementRef or onRef #636

Closed tanbowensg closed 2 years ago

tanbowensg commented 2 years ago

Changes

  1. Feat: Auto detect component's DOM element
  2. Fix: mask does not update after component state changes.
  3. add debounce time for update EditorMask

This is a fallback when component developer did not implement elementRef or onRef. The editor will traverse React Fiber Tree to find this component and its DOM Element, then use it to render EditorMask.

Because it uses React Fiber's implementation, it it not very stable. Developers should not rely on it.