Skip to content

Commit

Permalink
Update readme (#3491)
Browse files Browse the repository at this point in the history
Very modest fix. When converting to inches, we need to divide the number by 2.54. 😊
  • Loading branch information
iminside committed Aug 8, 2022
1 parent b82c7f3 commit 28e080e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/mobx-react-lite/README.md
Expand Up @@ -89,7 +89,7 @@ function Measurement({ unit }) {
get lengthWithUnit() {
// lengthWithUnit can only depend on observables, hence the above conversion with `useAsObservableSource`
return observableProps.unit === "inch"
? `${this.length * 2.54} inch`
? `${this.length / 2.54} inch`
: `${this.length} cm`
}
}))
Expand All @@ -104,7 +104,7 @@ function Measurement({ unit }) {
length: 0,
get lengthWithUnit() {
// lengthWithUnit can only depend on observables, hence the above conversion with `useAsObservableSource`
return this.unit === "inch" ? `${this.length * 2.54} inch` : `${this.length} cm`
return this.unit === "inch" ? `${this.length / 2.54} inch` : `${this.length} cm`
}
}))

Expand Down

0 comments on commit 28e080e

Please sign in to comment.