how do I dynamically render title as component

GTAUniverse

I have a scene:

<Scene key="myFeed" component={myFeed} renderTitle={level}/>

In which I use the component to display the "title". This function:

const level = () => {
  return (
     <Level/>
  )
}

This component:

export class Level extends Component {
    constructor(props) {
        super(props);


        this.state = {
            progressBar: {},
            loading: true,
        };

    }

    connection() {
        myApi.getServer('/user/level/', (data) => {
            this.setState({loading: false, progressBar: data});
        }, (err) => {
            console.log(err.message);
            this.setState({loading: false});
        })
    }

    render() {
        return(
            <View  style={styles.topBarCenterSlider}>
                   <View style={styles.topBarSlider}>
                          <View style={[styles.topBarStatus, {width: this.state.progressBar.level["progress"] + '%' : 0}]}/>
                          </View>
                   </View>
            </View>
        );
    }
}

I need to change the component after the server response. Help please, and sorry for my English))

Giang Le

I see you dont invoke "connection()". Put in componentWiLlMount

componentWillMount() {
  this.connection();
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I dynamically access or render Children in an Angular Component?

From Dev

How Do I Set Meteor Template Title On Render?

From Dev

How do I SAFELY render Markdown from a React component?

From Dev

How do I re-render a component manually?

From Dev

How do I render Markdown from a React component?

From Dev

How do I render a component when a button is clicked in React Native

From Dev

How do I render json in my react component?

From Dev

How to dynamically render JSX component X times?

From Dev

On url change i want to re render my component how should i do that

From Dev

How can I render a component that implements an interface?

From Dev

How do I render a shadow?

From Java

How do I render a new route that only shows a particular component in a SPA?

From Dev

ReactJS - How do I render out a component from several prop arrays?

From Dev

How do I render a list of items into my React Component from mlab?

From Dev

How do I Render a new component in React using Material-UI AppBar onTitleClick Property?

From Dev

Dynamically render a component inside a another component in React

From Dev

How do I dynamically inject an Angular2 sub component via typescript code?

From Dev

How can I generate title dynamically on ionic framework?

From Dev

how i can have a dynamically title in a book with XSLT and jQuery?

From Dev

How can I generate title dynamically on ionic framework?

From Dev

How to render html dynamically?

From Dev

How do I get the title UILabel of a UIViewController

From Java

How do I change the title of the legend in this ggplot

From Dev

How do I add a title to Seaborn Heatmap?

From Dev

How do I change GitLab <title>?

From Dev

How do I set a JSDoc tutorial title?

From Dev

How do I set Header or Title for CheckedListBox

From Dev

How do I title columns as a variable in SQL?

From Dev

How do I center the post title?

Related Related

  1. 1

    How do I dynamically access or render Children in an Angular Component?

  2. 2

    How Do I Set Meteor Template Title On Render?

  3. 3

    How do I SAFELY render Markdown from a React component?

  4. 4

    How do I re-render a component manually?

  5. 5

    How do I render Markdown from a React component?

  6. 6

    How do I render a component when a button is clicked in React Native

  7. 7

    How do I render json in my react component?

  8. 8

    How to dynamically render JSX component X times?

  9. 9

    On url change i want to re render my component how should i do that

  10. 10

    How can I render a component that implements an interface?

  11. 11

    How do I render a shadow?

  12. 12

    How do I render a new route that only shows a particular component in a SPA?

  13. 13

    ReactJS - How do I render out a component from several prop arrays?

  14. 14

    How do I render a list of items into my React Component from mlab?

  15. 15

    How do I Render a new component in React using Material-UI AppBar onTitleClick Property?

  16. 16

    Dynamically render a component inside a another component in React

  17. 17

    How do I dynamically inject an Angular2 sub component via typescript code?

  18. 18

    How can I generate title dynamically on ionic framework?

  19. 19

    how i can have a dynamically title in a book with XSLT and jQuery?

  20. 20

    How can I generate title dynamically on ionic framework?

  21. 21

    How to render html dynamically?

  22. 22

    How do I get the title UILabel of a UIViewController

  23. 23

    How do I change the title of the legend in this ggplot

  24. 24

    How do I add a title to Seaborn Heatmap?

  25. 25

    How do I change GitLab <title>?

  26. 26

    How do I set a JSDoc tutorial title?

  27. 27

    How do I set Header or Title for CheckedListBox

  28. 28

    How do I title columns as a variable in SQL?

  29. 29

    How do I center the post title?

HotTag

Archive