Open SamMousa opened 1 day ago
@SamMousa Please review our example.
Thank you, Andrew
I did, but it uses JSX which I don't use (and reasonably most non-react users won't be using.
And the example doesn't actually get references to the DOM nodes, it just creates react components recursively.
Yes, right. You can use the preact createElement function in this case.
Thank you, Andrew
Are you requesting a feature, reporting a bug or ask a question?
Question
What is the current behavior?
I'm moving from
survey-creator-knockout
tosurvey-creator-js
. I had a custom JSON editor tab (which uses Monaco editor) built in Svelte. I integrated this in knockout like this:The idea was that I register 1 component in knockout called
svelte-component
which then renders the correct component. The registration looks like this:How do I solve this in
survey-creator-js
? It seems I have to do it more in a react way, so I've done this:The issue here is that in this callback props never contain a reference to the given plugin. As far as I can understand, this code:
creator.addPluginTab('monaco', new SvelteEditorTab(creator, component), name, 'svelte-component');
basically says register the pluginSvelteEditorTab
and render it using the view / componentsvelte-component
, but I cannot reach one from the other.Another issue is that since I'm not in the React eco system I want to be able to manipulate "my part" of the DOM directly. But nowhere do I get a reference to the DOM node for my tab.
How would I do this in Vanilla JS?