Skip to content

Commit db2fcfa

Browse files
authored
Hint - allow user to send zero to props (#1289)
1 parent db3fcd5 commit db2fcfa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/components/hint/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ class Hint extends Component<HintProps, HintState> {
221221
}
222222

223223
get containerWidth() {
224-
const {containerWidth} = this.props;
225-
return containerWidth || Constants.screenWidth;
224+
const {containerWidth = Constants.screenWidth} = this.props;
225+
return containerWidth;
226226
}
227227

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

246246
get hintOffset() {
247-
const {offset} = this.props;
248-
return offset || DEFAULT_HINT_OFFSET;
247+
const {offset = DEFAULT_HINT_OFFSET} = this.props;
248+
return offset;
249249
}
250250

251251
get edgeMargins() {
252-
const {edgeMargins} = this.props;
253-
return edgeMargins || DEFAULT_EDGE_MARGINS;
252+
const {edgeMargins = DEFAULT_EDGE_MARGINS} = this.props;
253+
return edgeMargins;
254254
}
255255

256256
get useSideTip() {

0 commit comments

Comments
 (0)