Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'string' of undefined #19

Open
lahirukawijes opened this issue Nov 12, 2019 · 0 comments
Open

TypeError: Cannot read property 'string' of undefined #19

lahirukawijes opened this issue Nov 12, 2019 · 0 comments

Comments

@lahirukawijes
Copy link

  • Regarding the above error came up with the TextFieldGroup.js.
  • This worked for me
  • React is no more shipped with PropTypes. You will need to install it.
  • First install the prop-types package by running npm i prop-types --save.
  • Next use the prop-types package into your component like this:
import React from 'react'
import PropTypes from 'prop-types'

export const AwesomeComponent = props => {
    return(
        <h1>Hello {props.name}</h1>
    )
}

AwesomeComponent.propTypes = {
    name: PropTypes.string.isRequired
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant