Skip to content

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

@lahirukawijes

Description

@lahirukawijes
  • 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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions