В базовом React Native после создания пустого проекта через EXPO с установкой всех основных зависимостей, таких как
npm install --save react-navigation (for navigation),
npm install @material-ui/core (for material-ui),
npm install react react-dom (for react and react DOM),
npm install (for its dependencies)
после установки вышеупомянутых элементов, когда я копирую весь компонент кнопки, такой же, как указано в документации MATERIAL-UI .
и затем во время команды «expo start», которая строит команду, ошибка показывается, как показано ниже. сообщение об ошибке
Пожалуйста, помогите как можете !!!
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
const styles = theme => ({
button: {
margin: theme.spacing.unit,
},
input: {
display: 'none',
},
});
function TextButtons(props) {
const { classes } = props;
return (
<div>
<Button className={classes.button}>Default</Button>
<Button color="primary" className={classes.button}>
Primary
</Button>
<Button color="secondary" className={classes.button}>
Secondary
</Button>
<Button disabled className={classes.button}>
Disabled
</Button>
<Button href="#text-buttons" className={classes.button}>
Link
</Button>
<input
accept="image/*"
className={classes.input}
id="flat-button-file"
multiple
type="file"
/>
<label htmlFor="flat-button-file">
<Button component="span" className={classes.button}>
Upload
</Button>
</label>
</div>
);
}
TextButtons.propTypes = {
classes: PropTypes.object.isRequired,
};
export default withStyles(styles)(TextButtons);