@schedule-x/react 2.23.0 → 2.24.0

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
@@ -33,7 +33,7 @@ function ScheduleXCalendar({ calendarApp, customComponents }) {
33
33
  }, []);
34
34
  react.useEffect(() => {
35
35
  if (!calendarApp)
36
- return; // in SSR, calendarApp will be undefined
36
+ return; // before useEffect runs for the first time calendarApp is null
37
37
  for (const [componentName, Component] of Object.entries(customComponents || {})) {
38
38
  if (!Component)
39
39
  continue;
@@ -60,7 +60,7 @@ function useCalendarApp(config, plugins) {
60
60
  return calendarApp;
61
61
  }
62
62
  function useNextCalendarApp(config, plugins) {
63
- const [calendarApp, setCalendarApp] = react.useState();
63
+ const [calendarApp, setCalendarApp] = react.useState(null);
64
64
  react.useEffect(() => {
65
65
  if (typeof window !== 'undefined') {
66
66
  setCalendarApp(calendar.createCalendar(config, plugins));
package/dist/index.cjs.js CHANGED
@@ -33,7 +33,7 @@ function ScheduleXCalendar({ calendarApp, customComponents }) {
33
33
  }, []);
34
34
  react.useEffect(() => {
35
35
  if (!calendarApp)
36
- return; // in SSR, calendarApp will be undefined
36
+ return; // before useEffect runs for the first time calendarApp is null
37
37
  for (const [componentName, Component] of Object.entries(customComponents || {})) {
38
38
  if (!Component)
39
39
  continue;
@@ -60,7 +60,7 @@ function useCalendarApp(config, plugins) {
60
60
  return calendarApp;
61
61
  }
62
62
  function useNextCalendarApp(config, plugins) {
63
- const [calendarApp, setCalendarApp] = react.useState();
63
+ const [calendarApp, setCalendarApp] = react.useState(null);
64
64
  react.useEffect(() => {
65
65
  if (typeof window !== 'undefined') {
66
66
  setCalendarApp(calendar.createCalendar(config, plugins));
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ function ScheduleXCalendar({ calendarApp, customComponents }) {
31
31
  }, []);
32
32
  useEffect(() => {
33
33
  if (!calendarApp)
34
- return; // in SSR, calendarApp will be undefined
34
+ return; // before useEffect runs for the first time calendarApp is null
35
35
  for (const [componentName, Component] of Object.entries(customComponents || {})) {
36
36
  if (!Component)
37
37
  continue;
@@ -58,7 +58,7 @@ function useCalendarApp(config, plugins) {
58
58
  return calendarApp;
59
59
  }
60
60
  function useNextCalendarApp(config, plugins) {
61
- const [calendarApp, setCalendarApp] = useState();
61
+ const [calendarApp, setCalendarApp] = useState(null);
62
62
  useEffect(() => {
63
63
  if (typeof window !== 'undefined') {
64
64
  setCalendarApp(createCalendar(config, plugins));
@@ -1,9 +1,9 @@
1
1
  import { CalendarApp } from '@schedule-x/calendar';
2
2
  import React from 'react';
3
- import { CustomComponentName } from "@schedule-x/shared";
3
+ import { CustomComponentName } from '@schedule-x/shared';
4
4
  type ReactComponent = React.ComponentType<any>;
5
5
  type props = {
6
- calendarApp: CalendarApp | undefined;
6
+ calendarApp: CalendarApp | null;
7
7
  customComponents?: {
8
8
  [key in CustomComponentName]?: ReactComponent;
9
9
  };
@@ -1,4 +1,4 @@
1
- import { CalendarApp, CalendarConfig } from "@schedule-x/calendar";
2
- import { PluginBase } from "@schedule-x/shared";
1
+ import { CalendarApp, CalendarConfig } from '@schedule-x/calendar';
2
+ import { PluginBase } from '@schedule-x/shared';
3
3
  export declare function useCalendarApp<Plugins extends PluginBase<string>[]>(config: CalendarConfig, plugins?: Plugins): CalendarApp | null;
4
- export declare function useNextCalendarApp<Plugins extends PluginBase<string>[]>(config: CalendarConfig, plugins?: Plugins): CalendarApp | undefined;
4
+ export declare function useNextCalendarApp<Plugins extends PluginBase<string>[]>(config: CalendarConfig, plugins?: Plugins): CalendarApp | null;
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.23.0",
18
+ "version": "2.24.0",
19
19
  "type": "module",
20
20
  "files": [
21
21
  "dist"