Premium support for our pure JavaScript UI components


Post by jamesb »

Hello,

I noticed the TS typing have been updated in the 5.3 release.
We have two areas of our code (unchanged) that are impacted by the new typings following the update.

The following items object is part of the tbar config:

const tbar = { items: {
	layout: {
		type: "combo",
		items: [
			['stack', 'Stack'],
			['pack', 'Pack']
		],
		value: this.getEventLayout(),
		onChange: (e: any) => this.setEventLayout(e.value)
	}, ...
};
...
	<BryntumSchedulerPro
		project = {project}
		tbar = {tbar}
		...
	>
}

The TS compiler returns the following error:

TS2769: No overload matches this call.
Types of property 'type' are incompatible.
Type '"combo"' is not assignable to type '"schedulingmodecombo" | undefined'.

The other error is about a property we don't use in our code: maskDefaults.
The error is highlighted on the BryntumSchedulerPro React component:

      TS2769: No overload matches this call.
  Overload 1 of 2, '(props: BryntumSchedulerProProps | Readonly<BryntumSchedulerProProps>): BryntumSchedulerPro', gave the following error.
    Types of property 'maskDefaults' are incompatible.
      Type 'Partial<MaskConfig> | Mask | undefined' is not assignable to type 'Partial<MaskConfig> | undefined'.
        Type 'Mask' has no properties in common with type 'Partial<MaskConfig>'.
  Overload 2 of 2, '(props: BryntumSchedulerProProps, context: any): BryntumSchedulerPro', gave the following error.
    Types of property 'maskDefaults' are incompatible.
      Type 'Partial<MaskConfig> | Mask | undefined' is not assignable to type 'Partial<MaskConfig> | undefined'.

Is there a specific version of TS that you recommend?
Was there any change that could explain why this code which compiled with 5.2.x now fails to compile with 5.3.x?

Thank you,
J


Post by alex.l »

Hi J,

I've opened a ticket to investigate this problem https://github.com/bryntum/support/issues/6499
Meanwhile please use @ts-ignore for workaround.

All the best,
Alex


Post by sergey.maltsev »

Hi, J!

Could you please attach application which we can run and see the problem.
I was not able to reproduce errors with your configs above added to our react typescript basic demo.
Bundled demos can be found here https://bryntum.com/products/schedulerpro/docs/guide/SchedulerPro/download.


Post Reply