REACT Function can't see the state?

Trying to get a function working in the Parent component and pass it down as a prop.
I’m getting more and more confused.
I thought you could define functions like componentWillMount() or render() but these seem to have no access to my state so I put a function inside render.
Now that function (update) can’t read the state so I’m lost.
(maybe there is no state yet?)

EDITED:
This is the code that is invalid. Can anyone advise as to how to use the update function?

class App extends React.Component {
  constructor() {
    super();
   
      
    this.state = {
      recipes: recipeData 
    }
  }
 // note recipe data is an array of objects

  update(newText, id) {
      console.log(newText);
      
      if (this.state) {
          var recipes = this.state.recipes.map(
            r => (r.id !== id) ? 
            recipes: { ...recipes,
            recipes: newText }
            )
          this.setState({recipes : recipes})
      }
	
	  }

  
  render() {
       
    return (<div className="container">
        <h1 className="text-center">Online Recipe Book</h1>
        <div className="recipe-container">
         {this.state.recipes.map(function(r,i) {
          return <Recipe   
                   onChange={this.update()}
                   key={i} 
                   id={r.id}
                   name={r.name} 
                   servings={r.servings}
                   ingredients={r.ingredients} 
                   instructions={r.instructions}
         />
          })}
       
        </div>
      </div>
    )
  }
}

this.setState() is a function. React documentation shows it used like this:

this.setState({
    key: val,
    key: val
});

I have not seen it used like this.setState = {} before, maybe that is the issue?

JOhnny I feel like this is a codepen issue. have you tried developing locally yet? I think it’s worth the time to learn how to use create react app, that’s what I’ve been developing all my react projects in except for the most simple. (i did leaderboard on codepen, and that was just fetching and sorting)