Replies: 2 comments 1 reply
-
Integrating things with Solid is always the same in Solid whether you want to integrate with classes or anything else. You can't use them directly. Unless you have a more specific question it's hard to describe the whole process of integrating a vanilla JS library with Solid, but in order to get a general idea maybe you can look at how other people have already integrated vanilla libraries. |
Beta Was this translation helpful? Give feedback.
-
Typically you wrap these things in component wrappers. If you can pass the element in, instead of a selector is better. But generally you'd do something like: function DatePicker() {
onMount(() => {
const datePicker = MCDatepicker.create({
el: '#datepicker',
bodyType: 'modal'
});
onCleanup(() => datePicker.dispose());
});
return <div id="datepicker" />
} This is just a rough example. As I said getting a ref to the element would be better. |
Beta Was this translation helpful? Give feedback.
-
Hi Fellow SolidJs friends,
I am new to SolidJs and would like to use vanilla JS components in a SolidJs project.
For example this calendar:
https://mcdatepicker.netlify.app/usage
/* javascript */
const datePicker = MCDatepicker.create({
el: '#datepicker',
bodyType: 'modal'
});
Beta Was this translation helpful? Give feedback.
All reactions