Skip to content

Commit 6085b57

Browse files
leafkrobergilbarbara
authored andcommitted
convert default props to js defaults
1 parent 5b336a9 commit 6085b57

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

src/index.tsx

+9-22
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,26 @@ import { Props, State, Statuses, Styles } from './types';
2626

2727
function ReactFloater(props: Props): React.ReactElement {
2828
const {
29-
autoOpen,
29+
autoOpen = false,
3030
callback,
3131
children,
3232
component,
3333
content,
34-
debug,
35-
disableFlip,
36-
disableHoverToClick,
37-
event,
38-
eventDelay,
34+
debug = false,
35+
disableFlip = false,
36+
disableHoverToClick = false,
37+
event = 'click',
38+
eventDelay = 0.4,
3939
footer,
4040
getPopper,
41-
hideArrow,
41+
hideArrow = false,
4242
id,
4343
modifiers,
44-
offset,
44+
offset = 15,
4545
open,
4646
placement = 'bottom',
4747
portalElement,
48-
showCloseButton,
48+
showCloseButton = false,
4949
style,
5050
styles,
5151
target,
@@ -591,19 +591,6 @@ function ReactFloater(props: Props): React.ReactElement {
591591
);
592592
}
593593

594-
ReactFloater.defaultProps = {
595-
autoOpen: false,
596-
debug: false,
597-
disableFlip: false,
598-
disableHoverToClick: false,
599-
event: 'click',
600-
eventDelay: 0.4,
601-
hideArrow: false,
602-
offset: 15,
603-
placement: 'bottom',
604-
showCloseButton: false,
605-
};
606-
607594
export type {
608595
Action,
609596
CustomComponentProps,

0 commit comments

Comments
 (0)