ThomasThiebaud ThomasThiebaud - 6 months ago 44
React JSX Question

Element type is invalid (got: undefined) for react-redux component

I'm trying to create a component for

. Here is my component

import React, { PropTypes } from 'react'
import Input from 'react-toolbox'

export const TextField = ({ input, meta: { touched, error }, ...custom }) => (
error={touched && error}

TextField.propTypes = {
input: PropTypes.object,
meta: PropTypes.object

export default TextField

I also create an
file to easily import it

import TextField from './TextField'
export default TextField

Then I use it like this

import TextField from 'components/TextField'
import { Field } from 'redux-form'
<form onSubmit={props.handleSubmit(props.loginUser)}>
<Field type='email' label='Email' name='email' component={TextField} required />

But I get this error

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method of

I check again an again


Try to change:

import Input from 'react-toolbox'


import Input from 'react-toolbox/lib/input';


import {Input} from 'react-toolbox';

Both should work

I think that in your case Input is undefined imported like that