I updated my code to what you have above, and still have the same issue.
Screen Shot 2023-02-01 at 9.51.05 AM.png (50.38 KiB) Viewed 186 times
Screen Shot 2023-02-01 at 9.51.16 AM.png (62.69 KiB) Viewed 186 times
Screen Shot 2023-02-01 at 9.52.02 AM.png (306.84 KiB) Viewed 186 times
I am using scheduler pro. Any idea why I would still be getting this error?
Re: [REACT] Is there a way to disable error modal
Posted: Wed Feb 01, 2023 9:43 pm
by marcio
Hey,
I'm sharing a demo application with the latest version of SchedulerPro and with that configuration that Alex shared and it's working correctly, perhaps you could adapt this demo with your configuration to check what is causing that error to be triggered?
Re: [REACT] Is there a way to disable error modal
Posted: Wed Feb 01, 2023 11:21 pm
by peaguilar
Looking at your implementation I don't see anything that pokes out at me, and I even used your config in place of mine. I do notice that you guys are using js, and not typescript. Not sure if that would be something that would cause an issue. It wont let me build your app to convert it to TS to check. So the closest I have is to take your config file, and its still giving me the same error. Also, one thing that I notice is that even if I just declare a variable const stateProvider = StateProvider.setup('local'), and don't use it it still crashes the app, so I am not sure that this is an issue with the configuration of the app.
Re: [REACT] Is there a way to disable error modal
Posted: Wed Feb 01, 2023 11:39 pm
by marcio
Hey, I'm sharing a Typescript project with the state provider, please notice the version of the libs, but this one is also working without that error that you mentioned.
If this doesn't work out, we would like to ask you to share a sample project with that error happening on your side for us to check.
Re: [REACT] Is there a way to disable error modal
Posted: Thu Feb 02, 2023 5:10 pm
by peaguilar
Hey maybe I am missing something, but I dont see state provider being used in this example.
/**
* Application
*/
import React, { Fragment, FunctionComponent, useRef, useEffect } from 'react';
import { BryntumDemoHeader, BryntumThemeCombo, BryntumSchedulerPro } from '@bryntum/schedulerpro-react';
import { SchedulerPro } from '@bryntum/schedulerpro';
import { schedulerProConfig } from './AppConfig';
import './App.scss';
const App: FunctionComponent = () => {
const schedulerProRef = useRef<BryntumSchedulerPro>(null);
const schedulerProInstance = () => schedulerProRef.current?.instance as SchedulerPro;
useEffect(() => {
// This shows loading data
// To load data automatically configure project with `autoLoad : true`
schedulerProInstance().project.load();
});
return (
<Fragment>
{/* BryntumDemoHeader component is used for Bryntum example styling only and can be removed */}
<BryntumDemoHeader
children={<BryntumThemeCombo />}
/>
<BryntumSchedulerPro
ref={schedulerProRef}
{...schedulerProConfig}
/>
</Fragment>
);
};
export default App;
Re: [REACT] Is there a way to disable error modal
Posted: Thu Feb 02, 2023 5:15 pm
by marcio
Hey peaguilar,
Sorry, I shared the wrong file version, you can use this one instead
/**
* Application
*/
import React, { Fragment, FunctionComponent, useRef, useEffect } from 'react';
import { BryntumDemoHeader, BryntumThemeCombo, BryntumSchedulerPro } from '@bryntum/schedulerpro-react';
import { SchedulerPro, StateProvider } from '@bryntum/schedulerpro';
import { schedulerProConfig } from './AppConfig';
import './App.scss';
const stateProvider = StateProvider.setup("local");
const App: FunctionComponent = () => {
const schedulerProRef = useRef<BryntumSchedulerPro>(null);
const schedulerProInstance = () => schedulerProRef.current?.instance as SchedulerPro;
useEffect(() => {
// This shows loading data
// To load data automatically configure project with `autoLoad : true`
schedulerProInstance().project.load();
});
return (
<Fragment>
{/* BryntumDemoHeader component is used for Bryntum example styling only and can be removed */}
<BryntumDemoHeader
children={<BryntumThemeCombo />}
/>
<BryntumSchedulerPro
ref={schedulerProRef}
stateProvider={stateProvider}
{...schedulerProConfig}
/>
</Fragment>
);
};
export default App;
Re: [REACT] Is there a way to disable error modal
Posted: Thu Feb 02, 2023 5:22 pm
by peaguilar
And if you run this you don't see that error? I am unable to run this app. It doesn't allow me to install the dependencies to do so.