Skip to content

Commit

Permalink
Remove explicit React.FC type declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Apr 26, 2024
1 parent d920022 commit 039d20d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
6 changes: 2 additions & 4 deletions packages/react-calendar/src/CenturyView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ type CenturyViewProps = React.ComponentProps<typeof Decades>;
/**
* Displays a given century.
*/
const CenturyView: React.FC<CenturyViewProps> = function CenturyView(props) {
export default function CenturyView(props: CenturyViewProps) {
function renderDecades() {
return <Decades {...props} />;
}

return <div className="react-calendar__century-view">{renderDecades()}</div>;
};

export default CenturyView;
}
6 changes: 2 additions & 4 deletions packages/react-calendar/src/DecadeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ type DecadeViewProps = React.ComponentProps<typeof Years>;
/**
* Displays a given decade.
*/
const DecadeView: React.FC<DecadeViewProps> = function DecadeView(props) {
export default function DecadeView(props: DecadeViewProps) {
function renderYears() {
return <Years {...props} />;
}

return <div className="react-calendar__decade-view">{renderYears()}</div>;
};

export default DecadeView;
}
6 changes: 2 additions & 4 deletions packages/react-calendar/src/MonthView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type MonthViewProps = {
/**
* Displays a given month.
*/
const MonthView: React.FC<MonthViewProps> = function MonthView(props) {
export default function MonthView(props: MonthViewProps) {
const { activeStartDate, locale, onMouseLeave, showFixedNumberOfWeeks } = props;
const {
calendarType = getCalendarTypeFromLocale(locale),
Expand Down Expand Up @@ -110,6 +110,4 @@ const MonthView: React.FC<MonthViewProps> = function MonthView(props) {
</div>
</div>
);
};

export default MonthView;
}
6 changes: 2 additions & 4 deletions packages/react-calendar/src/YearView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ type YearViewProps = React.ComponentProps<typeof Months>;
/**
* Displays a given year.
*/
const YearView: React.FC<YearViewProps> = function YearView(props) {
export default function YearView(props: YearViewProps) {
function renderMonths() {
return <Months {...props} />;
}

return <div className="react-calendar__year-view">{renderMonths()}</div>;
};

export default YearView;
}

0 comments on commit 039d20d

Please sign in to comment.