Building a component that wants to handle rendering & events itself?

7 views
Skip to first unread message

Riley Eynon-Lynch

unread,
Mar 20, 2016, 4:16:01 PM3/20/16
to Substance
Hello,

I'd like to make a substance component to wrap mathquill for math typing ( http://mathquill.com/ ). Unfortunately, mathquill uses jQuery to manage its own state - it won't play nicely with a virtualdom approach, and it may not respect other contracts that substance assumes.

I have so far tried using `didMount` to find the actual DOM node that mathquill needs to take over, like this:

this.didMount = function() {
    var actualNode = jQuery('[data-id=' + this.props.node.id + ']');
    doOldStyleJqueryInitializationForMathquill(actualNode[0]);
};

But I'm getting all sorts of errors on the console (as I would expect). Is there a better way to make a component that reserves its own rendering space within the substance editor?  Maybe I can somehow mark the component within the substance UI to let it know 

Thanks for any help!

Riley
Reply all
Reply to author
Forward
0 new messages