UNPKG

substance

Version:

Substance is a JavaScript library for web-based content editing. It provides building blocks for realizing custom text editors and web-based publishing system. It is developed to power our online editing platform [Substance](http://substance.io).

13 lines (11 loc) 270 B
import Component from './Component' /* Looks for the first parent Component instance for a given native element. */ export function findParentComponent (el) { while (el) { const comp = Component.unwrap(el) if (comp) return comp el = el.parentNode } }