Page 1 of 2

[REACT] Getting Type Error after update from v4.0.3 to v5.2.2

Posted: Wed Nov 23, 2022 8:23 am
by mdali602

After updating bryntum scheduler pro from v4.0.3 to 5.2.2 few props are giving type error
using Bryntum Scheduler with React(typescript)

Below are the props which are giving errors.

filters={
"associates": [],
"activities": [],
"locations": [],
"groups": [],
"subCategories": [],
"savedFilters": {
"filtersList": []
}
},
updateEvents={updateEvents}, // getting value from a updateEvents function
updateResources={updateResources}, // getting value from a updateResources function
columnAutoWidth={false},
defaultResourceImageName={false},
eventColor={null},
eventStyle={colored},
resourceImageExtension={false},
snapToIncrement={true}

and for below lines getting an error
line1:

scheduler.current.schedulerInstance.refreshRows()

line2:

scheduler.current.schedulerInstance.clearEventSelection()

Error: "Property 'schedulerInstance' does not exist on type 'never'."

Line:

scheduler.current.resourceStore.getById(someId)

Error: Property 'resourceStore' does not exist on type 'never'.

Line:

scheduler.current.eventStore._data

Error: Property 'eventStore' does not exist on type 'BryntumScheduler'


Re: [REACT] Getting Type Error after update from v4.0.3 to v5.2.2

Posted: Wed Nov 23, 2022 9:38 am
by alex.l

Please check updated guide here https://bryntum.com/products/scheduler/docs/guide/Scheduler/integration/react/guide#using-the-wrapper-in-typescript-application

const App: FunctionComponent = () => {
    const schedulerRef = useRef<BryntumScheduler>(null);
    const schedulerInstance = () => schedulerRef.current?.instance as Scheduler;

return (
    <Fragment>
        <BryntumScheduler
            ref = {schedulerRef}
            {...schedulerConfig}
        />
    </Fragment>
);
};

Re: [REACT] Getting Type Error after update from v4.0.3 to v5.2.2

Posted: Fri Nov 25, 2022 8:54 am
by mdali602

I went through the above documentation did the required changes but still getting error
Sharing the Screenshot of the error


Re: [REACT] Getting Type Error after update from v4.0.3 to v5.2.2

Posted: Fri Nov 25, 2022 12:35 pm
by tasnim

Could you please provide us a runnable test case so we can reproduce and debug it?


Re: [REACT] Getting Type Error after update from v4.0.3 to v5.2.2

Posted: Mon Dec 05, 2022 3:12 pm
by mdali602

Hi Tasnim,

As you asked, I'm sharing the runnable test repo link.
Basically I replicated the issue in a separate github repo (https://github.com/mdali602/bryntum-app)
You can run this this code simply running below two commands
$npm i
$npm start

After running this, There you can see the typescript errors.


Re: [REACT] Getting Type Error after update from v4.0.3 to v5.2.2

Posted: Mon Dec 05, 2022 3:42 pm
by marcio

Hey mdali602,

We don't have a horizontalColumns property, only columns. I attached a print from our documentation to confirm.

Also, I checked in our API diff tool https://bryntum.com/products/schedulerpro/docs/api/apidiff and we don't have a horizontalColumns property on 4.0.2 as well, where did you see that configuration??


Re: [REACT] Getting Type Error after update from v4.0.3 to v5.2.2

Posted: Fri Dec 16, 2022 12:48 pm
by mdali602

Hi,

we're curios to know How frequently we should update the bryntum version asking because we found a lot of major changes between bryntum scheduler v4.0.2 and bryntum scheduler pro v5.2.2.

Please let us know what is the preferred interaval of upgradation you suggest ?

Thanks


Re: [REACT] Getting Type Error after update from v4.0.3 to v5.2.2

Posted: Fri Dec 16, 2022 2:34 pm
by mats

Ideally you upgrade frequently, it's easier to do small updates than to jump 10 versions in one upgrade. It's expected to find major changes happening in major releases, so need to take extra care when doing a major upgrade and study our upgrade guides and info.


Re: [REACT] Getting Type Error after update from v4.0.3 to v5.2.2

Posted: Tue Dec 20, 2022 8:01 am
by mdali602

Hi Bryntum Team,
Facing some issues in bryntum latest version. I tried to create a runnable test I was not able to install bryntum scheduler on an online plateform stackblitz . I also tried replicating in fresh repo but Its difficult to replicate there.

So Is this possible we can connect on a virtual call ?


Re: [REACT] Getting Type Error after update from v4.0.3 to v5.2.2

Posted: Tue Dec 20, 2022 5:55 pm
by marcio

Hey mdali602,

You can send an email to support[at]bryntum.com for discussing a virtual call to assist you.