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?)

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

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

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

  render() {
    return (<div className="container">
        <h1 className="text-center">Online Recipe Book</h1>
        <div className="recipe-container">
         {,i) {
          return <Recipe   

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

    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)