Error after Using The Custom Component

  • Goal:
    I want to Implement a Mobi Scroll Plugin with Events

    const onEventCreate = Retool.useEventCallback({ name: "onEventCreate" });

  • Steps:

When I use const onEventCreate = Retool.useEventCallback({ name: "onEventCreate" });

in React, And i will open settings in

  • Details:

import React from 'react'
import { type FC } from 'react'
import { useMemo } from 'react';

import { Retool } from '@tryretool/custom-component-support'
import { Eventcalendar, setOptions, localeDe, MbscEventcalendarView, createCustomTheme } from '@mobiscroll/react'
import '@mobiscroll/react/dist/css/mobiscroll.min.css';
import './mobiscroll.react.min.css';
import tr from '@mobiscroll/react/dist/src/i18n/tr'

setOptions({
locale: localeDe,
theme: 'myadvisori',
themeVariant: 'light'
});

export const PlanceOverview: FC = () => {

const myView: MbscEventcalendarView = useMemo(
() => ({
timeline: {
type: 'month',
},
}),
,
);
const [Resources , _setResources] = Retool.useStateArray({
name: 'resources',
initialValue: ,
description: 'Resources for the calendar'
});
const [Events , _setEvents] = Retool.useStateArray({
name: 'events',
initialValue: ,
description: 'Events for the calendar'
});
const [Holidays , _setHolidays] = Retool.useStateArray({
name: 'hoildays',
initialValue: ,
description: 'Holidays for the calendar'
});
const [CurrentDate , _setCurrentDate] = Retool.useStateString({
name: 'currentDate',
initialValue: '',
description: 'CurrentDate for the calendar'
});

const onEventCreate = Retool.useEventCallback({ name: "onEventCreate" });
console.log(onEventCreate);
// const onEventDelete = Retool.useEventCallback({ name: "onEventDelete" });

return (
<div style={{ height: "calc(100% - 10px)" }}>
<Eventcalendar
invalid={Holidays}
clickToCreate={true}
dragToCreate={true}
dragToMove={false}
dragToResize={false}
eventDelete={true}
view={myView}
data={Events}
resources={Resources}
selectedDate={CurrentDate}
showToday={false}

  />
</div>

)
}

Hey guys have anyone a idea why i get this error ? iRegards Asan

Hello @Asan_Stefanski!

I am not sure what is causing this bug, but I would love to help you get it figured out! Unfortunately that error message is not very helpful.....

I have a couple questions, I am going to try to reproduce this bug.

Are you using the custom component library or legacy custom components?

What version of Retool are you using?

In your mobile app's Settings (wheel icon) on the left, did you add in all the libraries you are using?

What is the purpose/use case for you Mobile Scroll plugin? Do you want to have an infinite scroll or some specific behavior?

We might have a retool component that can accomplish the same functionality, custom components are fickle and combining with our new mobile app is a very new use case we are still developing :sweat_smile:

I would definitely prefer to see if we can use our prebuilt components to build your app and only use custom HTML/JS if necessary :crossed_fingers:

Sorry! I don't have the answer to your question, but maybe you could help me with my problem with the custom component.

Thank you very much!

@andrii.krykun.1988 Hello I can take a look on that post! Stay tuned :sweat_smile: