creativetimofficial / now-ui-react-native

Now UI Pro React Native
MIT License
193 stars 441 forks source link

[Bug] You started loading the font "montserrat-regular", but used it before it finished loading. #24

Closed anilravrani closed 3 years ago

anilravrani commented 4 years ago

Version

1.0.1

Reproduction link

https://github.com/creativetimofficial/now-ui-react-native#technical-support-or-questions

Operating System

ANDROID

Device

Redmi 4

Browser & Version

Expo

Steps to reproduce

clone the repository of free code run npm install run expo start

What is expected?

should run the app

What is actually happening?

getting error


Solution

Additional comments

You started loading the font "montserrat-regular", but used it before it finished loading.

webmailcontatos commented 4 years ago

Replace function componentDidMount. Fixed the problem async componentDidMount() { await Font.loadAsync({ 'montserrat-regular': require('./assets/font/Montserrat-Regular.ttf'), 'montserrat-bold': require('./assets/font/Montserrat-Bold.ttf') } ); this.setState({fontLoaded: true, isLoadingComplete: true}); }

PA55ION commented 4 years ago

@webmailcontatos Thank you this solution is solved my problem I have to add await and also have to add isLoadingComplete: true otherwise my screen will stuck at loading screen even though it show me that loading complete.

palingheorghe commented 3 years ago

This shouldn't be a problem anymore as this was solved by previous versions. Thank you for your interest in our products!