Skip to content

Hint - allow user to send zero to props #1289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/components/hint/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ class Hint extends Component<HintProps, HintState> {
}

get containerWidth() {
const {containerWidth} = this.props;
return containerWidth || Constants.screenWidth;
const {containerWidth = Constants.screenWidth} = this.props;
return containerWidth;
}

get targetLayout() {
Expand All @@ -244,13 +244,13 @@ class Hint extends Component<HintProps, HintState> {
}

get hintOffset() {
const {offset} = this.props;
return offset || DEFAULT_HINT_OFFSET;
const {offset = DEFAULT_HINT_OFFSET} = this.props;
return offset;
}

get edgeMargins() {
const {edgeMargins} = this.props;
return edgeMargins || DEFAULT_EDGE_MARGINS;
const {edgeMargins = DEFAULT_EDGE_MARGINS} = this.props;
return edgeMargins;
}

get useSideTip() {
Expand Down