Skip to content

Commit 465483f

Browse files
committed
Revert "refactor: replace defaultProps with default parameters"
This reverts commit 50688d5.
1 parent 50688d5 commit 465483f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/courseware/course/Course.jsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import { CourseOutlineMobileSidebarTriggerSlot } from '../../plugin-slots/Course
1919
import { CourseBreadcrumbsSlot } from '../../plugin-slots/CourseBreadcrumbsSlot';
2020

2121
const Course = ({
22-
courseId = null,
23-
sequenceId = null,
24-
unitId = null,
22+
courseId,
23+
sequenceId,
24+
unitId,
2525
nextSequenceHandler,
2626
previousSequenceHandler,
2727
unitNavigationHandler,
@@ -137,6 +137,12 @@ Course.propTypes = {
137137
windowWidth: PropTypes.number.isRequired,
138138
};
139139

140+
Course.defaultProps = {
141+
courseId: null,
142+
sequenceId: null,
143+
unitId: null,
144+
};
145+
140146
const CourseWrapper = (props) => {
141147
// useWindowSize initially returns an undefined width intentionally at first.
142148
// See https://www.joshwcomeau.com/react/the-perils-of-rehydration/ for why.

src/generic/user-messages/UserMessagesProvider.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function popFlashMessages() {
2929
return popLocalStorage(FLASH_MESSAGES_LOCAL_STORAGE_KEY) || [];
3030
}
3131

32-
const UserMessagesProvider = ({ children = null }) => {
32+
const UserMessagesProvider = ({ children }) => {
3333
// Note: The callbacks (add, remove, clear) below interact with useState in very subtle ways.
3434
// When we call setMessages, we always do so with the function-based form of the handler, making
3535
// use of the "current" state and not relying on lexical scoping to access the state exposed
@@ -102,4 +102,8 @@ UserMessagesProvider.propTypes = {
102102
children: PropTypes.node,
103103
};
104104

105+
UserMessagesProvider.defaultProps = {
106+
children: null,
107+
};
108+
105109
export default UserMessagesProvider;

0 commit comments

Comments
 (0)