Skip to content

Commit b78b4c7

Browse files
authored
Fix console warning defaultProps deprecated (#852)
fix() : Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead. Signed-off-by: sBouzols <[email protected]>
1 parent 1df46ab commit b78b4c7

File tree

2 files changed

+11
-30
lines changed

2 files changed

+11
-30
lines changed

demo/src/TreeViewFinderConfig.jsx

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ import { Checkbox, FormControl, FormControlLabel, FormGroup, FormLabel, Radio, R
2424
*/
2525
function TreeViewFinderConfig(props) {
2626
const {
27-
dynamicData,
28-
dataFormat,
29-
multiSelect,
30-
onlyLeaves,
31-
sortedAlphabetically,
32-
onDynamicDataChange,
33-
onDataFormatChange,
34-
onSelectionTypeChange,
35-
onOnlyLeavesChange,
36-
onSortedAlphabeticallyChange,
27+
dynamicData = false,
28+
dataFormat = 'Tree',
29+
multiSelect = false,
30+
onlyLeaves = false,
31+
sortedAlphabetically = false,
32+
onDynamicDataChange = () => {},
33+
onDataFormatChange = () => {},
34+
onSelectionTypeChange = () => {},
35+
onOnlyLeavesChange = () => {},
36+
onSortedAlphabeticallyChange = () => {},
3737
} = props;
3838

3939
return (
@@ -133,17 +133,4 @@ TreeViewFinderConfig.propTypes = {
133133
onSortedAlphabeticallyChange: PropTypes.func,
134134
};
135135

136-
TreeViewFinderConfig.defaultProps = {
137-
dynamicData: false,
138-
dataFormat: 'Tree',
139-
multiSelect: false,
140-
onlyLeaves: false,
141-
sortedAlphabetically: false,
142-
onDynamicDataChange: () => {},
143-
onDataFormatChange: () => {},
144-
onSelectionTypeChange: () => {},
145-
onOnlyLeavesChange: () => {},
146-
onSortedAlphabeticallyChange: () => {},
147-
};
148-
149136
export default TreeViewFinderConfig;

demo/src/right-resizable-box.jsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const styles = {
5353
const ResizableBoxSx = styled(ResizableBox)({});
5454

5555
function RightResizableBox(props) {
56-
const { children, disableResize, fullscreen, hide } = props;
56+
const { children, disableResize = false, fullscreen = false, hide = false } = props;
5757
const windowWidth = useWindowWidth();
5858

5959
const [resizedTreePercentage, setResizedTreePercentage] = useState(0.5);
@@ -86,12 +86,6 @@ function RightResizableBox(props) {
8686
);
8787
}
8888

89-
RightResizableBox.defaultProps = {
90-
disableResize: false,
91-
fullscreen: false,
92-
hide: false,
93-
};
94-
9589
RightResizableBox.propTypes = {
9690
children: PropTypes.node,
9791
disableResize: PropTypes.bool,

0 commit comments

Comments
 (0)