title: Cannot read properties of undefined (sub-schema not working) : Mosh React Course
body: <p>Learning React from <strong>Code with Mosh</strong> with Typescript got stuck in <code>Form Section</code>
  Getting error on <code>validateProperty</code> function</p>
  <pre><code> validate = () =&gt; {
      let options = {abortEarly:false}
      const {error} = Joi.validate(this.state.data, this.schema, options);
      if (!error) return null;
  
      const errors : any = {};
      for (let item of error.details)
          errors[item.path[0]] = item.message;
      return errors;
   }
  
  validateProperty = ({name, value} : HTMLInputElement) =&gt; {
      const obj = { [name] : value };
  
      // **getting error in below line** 
      const schema = { [name] : this.schema[name] }
  
      const { error } = Joi.validate(obj, schema);
      return (error) ? error.details[0].message : null;
  }
  </code></pre>
  <p>I also did try <a href="https://github.com/sideway/joi/issues/2354" rel="nofollow noreferrer">devtarek</a> solution but not worked <br>
  I did find the <code>joi-browser</code> version <code>13.4</code> is <em><strong>outdated</strong></em> that's why unable to access <code>property</code> like this - said by someone on <strong>github</strong> (follow above link)<br>
  Please let me know if any additional details required. I will update it. TThanks</p>