Skip to content

Commit

Permalink
fix: resolve 'React is not defined' error
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan J committed Feb 6, 2025
1 parent 10bc9d0 commit 36e04b3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Header/MonthButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dayjs from 'dayjs';
import { Pressable, StyleSheet, Text, View } from 'react-native';
import { useCalendarContext } from '../../CalendarContext';
import { memo } from 'react';
import React, { memo } from 'react';

const MonthButton = () => {
const { currentDate, calendarView, setCalendarView, theme, locale } =
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/Selectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useCalendarContext } from '../../CalendarContext';
import MonthButton from './MonthButton';
import YearButton from './YearButton';
import dayjs from 'dayjs';
import { memo } from 'react';
import React, { memo } from 'react';

const Selectors = () => {
const { mode, date, calendarView, setCalendarView, theme, timePicker } =
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/YearButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Pressable, StyleSheet, Text, View } from 'react-native';
import { useCalendarContext } from '../../CalendarContext';
import { getDateYear, getYearRange } from '../../utils';
import dayjs from 'dayjs';
import { memo } from 'react';
import React, { memo } from 'react';

const YearButton = () => {
const {
Expand Down
2 changes: 1 addition & 1 deletion src/components/WeekDays.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { memo } from 'react';
import React, { memo } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { getWeekdaysMin } from '../utils';
import { CalendarThemeProps } from '../types';
Expand Down

7 comments on commit 36e04b3

@xzainaby
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is not included in the latest release, I had to use patch-package to go around it. It would be great if it was published.

@farhoudshapouran
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please upgrade to v3.0.2 and if this issue is not fixed let me know, thanks.

@xzainaby
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is updated now, but apparently this update is not built so I am still getting errors trying to run it

@farhoudshapouran
Copy link
Owner

@farhoudshapouran farhoudshapouran commented on 36e04b3 Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What kind of error did you face in the latest version that has not been built, and what is your react and react-native version?

@xzainaby
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"react": "18.3.1",
"react-native": "0.76.6",

The error I am getting is unable to find lib/commonjs/index (the specified main in package.json)

@farhoudshapouran
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right, I fixed it today would you please upgrade to v3.0.3 and try again?

@xzainaby
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It finally worked! Thank you for the fast support

Please sign in to comment.