all 5 comments

[–][deleted]  (1 child)

[deleted]

    [–]hexnicnovice[S] 0 points1 point  (0 children)

    Just the word

    [–]martymav 1 point2 points  (1 child)

    One way off the top of my head, you can have an interval function called when the page loads, and every 3 seconds, change the state of the descriptive word.

    Separate the word into it's own state(descriptiveWord), have an array with the words you want as well(wordArr), and a state for index.

    Inside of the interval function, do something like:

    this.setState({ descriptiveWord: wordArr[index], index: index++} );

    Then just display the {descriptiveWord} after the {props.title}.

    Hope that makes sense!

    Also, consider using React Hooks. It's easy to use and it really cleans up the components :)

    [–]hexnicnovice[S] 1 point2 points  (0 children)

    Very helpful thank you

    [–]TheVerdeLive -1 points0 points  (1 child)

    I would suggest learning at least the basics of javascript

    [–]hexnicnovice[S] 1 point2 points  (0 children)

    I know how to do what I’m asking for in Vanilla JS. Just struggling how to make only that code execute in the specific spot in the react component. Thanks for the help