Hi,
To get rid of this waring, you should use the config from external file or use useState() for tbar config.
Otherwise React will recreate tbar on each rendering cycle and you will receive this warning.
Here is an example code snippet of using the config from external file :
Thank you for your help. Save the tbar inside a useState works well, when I show the tooltip the warning is not appear anymore. But in the end I used a useMemo because sometime I need to update the tbar.
For example I need to call a api event every time a week change inside the date picker. And it doesn't work with a useState. Also in this case when I call the api every Monday of the week the warning appear again.
Another example is about the useListeners: I took it from the react-vertical-exemple by Bryntum doc.
Inside that there are a lot of functions to manage my events. But every time I do something I receive the warning about this component.
Warning:
BryntumSchedulerComponent development warning!
"listeners" is a static config option for component constructor only
Anyway I have a lot of this type of warning inside my application related to different part.
That I'd like to understand is how can I fix this waring in the different part of my scheduler. I think they have a common solution.
I attach a simple copy of app. Following I text you a list of instruction to use it.
Double click on the scheduler to open the modal to chose a customer
Because of errors, I can not run your application, Could you please provide a test case that I can run the app without any errors and give you the solution right away?
Ok I attach the new test case without node module.
Could you please just check the warning about the useListeners, because it's a test case and I also have others warning that I don't have on my application.
I couldn't make it working; here are the first errors:
Screen Shot 2022-06-10 at 19.44.12.png (1.59 MiB) Viewed 663 times
Without running the application I can only say generally that warnings you saw must be fixed as they could be symptom of something more serious. The reason is that your React application sets the changed values of the config options at runtime. That is not allowed. Only properties can be set at runtime, not configs.
thank you so much for your suggestion. I understood how I have to use the useEffect inside the useListeners to remove the warning. It's work perfectly!
Thank you so much!
I still have a little problem with the same warning about tbar. As Tasnim said, save the tbar iside a useState works well, but I can't update the data from redux inside the config.
I should conditional an api call on my picker date button inside the tbar config. To do that I use some data from redux. I saw inside the config I didn't receive any update about external constants.
I also need to condition others function in the next tasks and I'd like to use some useState?