Code
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import axios from 'axios';
import { connect } from 'react-redux';
import * as actions from '../../reducks/auth/actions';
import CircularProgress from "@material-ui/core"
class Add_Want_Item_Form extends Component {
constructor(props) {
super(props);
this.state = {
// #インプット情報用
info: {
name: '',
owner: '',
keyword1: '',
keyword2: '',
keyword3: '',
bland: '',
url: '',
},
// Validation用
// urlは必須項目ではないのでValidationには含めない
message: {
name: '',
keyword1: '',
keyword2: '',
keyword3: '',
bland: '',
},
};
this.handleChange = this.handleChange.bind(this);
}
componentDidMount() {
axios
.get('http://localhost:8000/api/user/' + this.state.uid)
.then((res) => console.log(res))
.catch((err) => console.log(err));
}
handleChange(e) {
const name = e.target.name;
const value = e.target.value;
const { info, message } = this.state;
this.setState({
info: { ...info, [name]: value },
});
this.setState({
message: { ...message, [name]: this.validator(name, value) },
});
}
////
...
////
render() {
const { info, message } = this.state;
return (
<div>
<label>商品名</label>
<input name="name" type="text" value={this.state.info.name} onChange={this.handleChange} />
<p>{this.state.message.name}</p>
</div>
);
}
}
const mapStateToProps = (state) => {
return {
uid: state.uid,
};
};
export default connect(mapStateToProps)(Add_Want_Item_Form);
Problem
super gets strikethrough in React although that doesn't show up in stackoverflow.
I am using VS Code (1.49.0).
I just noticed after I installed @material-ui/core.
Honestly, I cannot say exactly when this happened.
I guess the cause is not @material-ui/core but I don't know what causes this.
In addition to that, I don't know what effects it has to my project.
What does it mean? And what happens this strikethrough? Would you please teach me them?
Thank you very much.