FirstReactProject

This is My code

import React, { Component } from 'react';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import AppBar from 'material-ui/AppBar';
import TextField from 'material-ui/TextField';
import RaisedButton from 'material-ui/RaisedButton';

export class FormUserDetails extends Component {
    continue = event => {
        event.preventDefault();
        this.props.nextStep();
    };
    
    
    render() {
        const { values, handleChange } = this.props;

        return (
            <MuiThemeProvider>
                <React.Fragment>
                    <AppBar title = "Enter User Details" />
                    <TextField 
                        hintText = "Enter Your First Name"
                        floatingLabelText = "First Name"
                        onChange = {handleChange('firstName')}
                    />
                </React.Fragment>
            </MuiThemeProvider>
        )
    }
}

export default FormUserDetails;

I get an error:

Failed to Compile
./src/components/FormUserDetails.jsModule not found:
 Can't resolve 'material-ui/AppBar' in
 'C:\Users\DELL\Desktop\ReactApp\my-app\src\components'

What should I have to do? Please Help me

The thing you’re trying to import isn’t there. Are you sure

  1. this import statement is correct:
import AppBar from 'material-ui/AppBar';

And

  1. if it is, that it is installed?

Thank you @DanCouper for the reply. I just install new versionof material-ui 4.0.0 something. It’s working🙌 .

1 Like