Skip to content

Commit 48c1b1d

Browse files
author
Alberto Martínez
authored
Update README.md
1 parent ea6cf77 commit 48c1b1d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Unlike measure, `null` elements returns 0 without generating error, and empty st
239239
//...
240240
import rnTextSize, { TSFontSpecs } from 'react-native-text-size'
241241

242-
type Props = {}
242+
type Props = { texts: string[] }
243243
type State = { heights: number[] }
244244

245245
// On iOS 9+ will show 'San Francisco' and 'Roboto' on Android
@@ -257,6 +257,7 @@ class Test extends Component<Props, State> {
257257
}
258258

259259
async componentDidMount() {
260+
const { texts } = this.props
260261
const width = Dimensions.get('window').width * 0.8
261262
const heights = await rnTextSize.flatHeights({
262263
text: texts, // array of texts to measure, can include symbols
@@ -269,6 +270,7 @@ class Test extends Component<Props, State> {
269270
}
270271

271272
render() {
273+
const { texts } = this.props
272274
const { heights } = this.state
273275

274276
return (

0 commit comments

Comments
 (0)