react-live-clock: Invariant Violation: Text strings must be rendered within a component.

This is my render function:

render() {
    return (
      <View style={styles.container}>
        <Text style={styles.text}>Hello World!
          <Clock format={'HH:mm:ss'} ticking={true} timezone={'US/Pacific'} />
        </Text>
        
      </View>
    );
  }

There is an error coming up:

Invariant Violation: Text strings must be rendered within a <Text> component.

Moving <Clock> outside <Text> and even <View> doesn’t fix the problem.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 26

Commits related to this issue

Most upvoted comments

No problem at all Anthony, thanks so much for your efforts. I just tried it and can confirm the error has disappeared. All the best!