Had to modify types file for linting to pass...
Hi! π
Firstly, thanks for your work on this project! π
Today I used patch-package to patch [email protected] for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-calendars/src/calendar/index.d.ts b/node_modules/react-native-calendars/src/calendar/index.d.ts
index 56915b1..353509f 100644
--- a/node_modules/react-native-calendars/src/calendar/index.d.ts
+++ b/node_modules/react-native-calendars/src/calendar/index.d.ts
@@ -54,9 +54,5 @@ export interface CalendarProps extends CalendarHeaderProps, DayProps {
* @example: https://github.com/wix/react-native-calendars/blob/master/example/src/screens/calendars.js
* @gif: https://github.com/wix/react-native-calendars/blob/master/demo/assets/calendar.gif
*/
-declare const Calendar: {
- (props: CalendarProps & ContextProp): React.JSX.Element;
- displayName: string;
- propTypes: any;
-};
+declare const Calendar: (props: CalendarProps & ContextProp) => React.JSX.Element;
export default Calendar;
This issue body was partially generated by patch-package.
A workaround here:
import { Calendar as BaseCalendar, CalendarProps } from 'react-native-calendars';
import { ContextProp } from 'react-native-calendars/src/types';
export const Calendar = (props: CalendarProps & ContextProp) => {
return <BaseCalendar {...props} />;
};
If a workaround is required, they need to make a patch... Wix hopefully has lots of devs to make the PR
An workaround here:
import { Calendar as BaseCalendar, CalendarProps } from 'react-native-calendars'; import { ContextProp } from 'react-native-calendars/src/types';
export const Calendar = (props: CalendarProps & ContextProp) => { return <BaseCalendar {...props} />; };
@Kurogoma4D this is inside of a custom component file or index.d.ts?
@NoodleOfDeath It's a custom component. I agree to need some patch, but this workaround is required for me.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@NoodleOfDeath It's a custom component. I agree to need some patch, but this workaround is required for me.
This patch is just to make TypeScript linting happy, which means vscode will throw a lot of errors without the patch/workaround
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.