3

I have this react native app that shows the splash screen first and loads a home screen. The sample home screen shows text as "Demo Display" and I want to change it to "Text Changed!". I'm using a stateful class component. But everytime I try to restart/reinstall/debug the app the text remains same as "Demo Display". How can I fix this?

App.js

import React,{ Component } from 'react'
import { View, Text } from 'react-native'
import SplashScreen from 'react-native-splash-screen'

export default class App extends Component {

  componentDidMount() {
      SplashScreen.hide();
  }

  render() {
    return (
      <View>
        <Text>Text Changed!</Text>
      </View>
    );
  }
}

This is a screen shot of the app

1 Answer 1

2

Your text is there on the screen but it will not replace the default text. Give some style to your main View and you will see your text there. Try,

<View style={{justifyContent: 'center',alignItems: 'center'}}>
  <Text>Text Changed!</Text>
</View>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.