Create Hoverifier component
Created by: tjkandala
Create a Hoverifier
component that manages a hoverifier instance. Like the new Decorator
component, which handles setting and clearing line decorations, it enables us to write simple function components that only concern themselves with React state; these components handle any other DOM manipulation. We'd have to liberally use refs
to recreate this functionality in function components.
TODO:
- Fix URL update bug. Some clicks don't trigger click events since the ref is occasionally set to null. Two possible strategies to stabilize ref:
- Find a way to make ref callback stable. Possibly extract function child to a component and memoize callback.
- Don't emit elements on null