@schedule-x/react 2.21.1 → 2.21.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -53,7 +53,10 @@ function ScheduleXCalendar({ calendarApp, customComponents }) {
53
53
  }
54
54
 
55
55
  function useCalendarApp(config, plugins) {
56
- const [calendarApp] = react.useState(() => calendar.createCalendar(config, plugins));
56
+ const [calendarApp, setCalendarApp] = react.useState(null);
57
+ react.useEffect(() => {
58
+ setCalendarApp(calendar.createCalendar(config, plugins));
59
+ }, []);
57
60
  return calendarApp;
58
61
  }
59
62
  function useNextCalendarApp(config, plugins) {
package/dist/index.cjs.js CHANGED
@@ -53,7 +53,10 @@ function ScheduleXCalendar({ calendarApp, customComponents }) {
53
53
  }
54
54
 
55
55
  function useCalendarApp(config, plugins) {
56
- const [calendarApp] = react.useState(() => calendar.createCalendar(config, plugins));
56
+ const [calendarApp, setCalendarApp] = react.useState(null);
57
+ react.useEffect(() => {
58
+ setCalendarApp(calendar.createCalendar(config, plugins));
59
+ }, []);
57
60
  return calendarApp;
58
61
  }
59
62
  function useNextCalendarApp(config, plugins) {
package/dist/index.js CHANGED
@@ -51,7 +51,10 @@ function ScheduleXCalendar({ calendarApp, customComponents }) {
51
51
  }
52
52
 
53
53
  function useCalendarApp(config, plugins) {
54
- const [calendarApp] = useState(() => createCalendar(config, plugins));
54
+ const [calendarApp, setCalendarApp] = useState(null);
55
+ useEffect(() => {
56
+ setCalendarApp(createCalendar(config, plugins));
57
+ }, []);
55
58
  return calendarApp;
56
59
  }
57
60
  function useNextCalendarApp(config, plugins) {
@@ -1,6 +1,4 @@
1
- import { CalendarApp, CalendarConfig } from '@schedule-x/calendar';
2
- import { PluginBase } from '@schedule-x/shared';
3
- export declare function useCalendarApp<Plugins extends PluginBase<string>[]>(config: CalendarConfig, plugins?: Plugins): CalendarApp & { [Name in Plugins[number]["name"]]: Extract<Plugins[number], {
4
- name: Name;
5
- }>; };
1
+ import { CalendarApp, CalendarConfig } from "@schedule-x/calendar";
2
+ import { PluginBase } from "@schedule-x/shared";
3
+ export declare function useCalendarApp<Plugins extends PluginBase<string>[]>(config: CalendarConfig, plugins?: Plugins): CalendarApp | null;
6
4
  export declare function useNextCalendarApp<Plugins extends PluginBase<string>[]>(config: CalendarConfig, plugins?: Plugins): CalendarApp | undefined;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "main": "dist/index.cjs",
16
16
  "module": "dist/index.js",
17
17
  "types": "dist/types/index.d.ts",
18
- "version": "2.21.1",
18
+ "version": "2.21.3",
19
19
  "type": "module",
20
20
  "files": [
21
21
  "dist"