mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-13 07:34:36 +01:00
fix derived state
This commit is contained in:
@@ -30,10 +30,6 @@ export default class TextInput extends React.Component<IProps, IState> {
|
||||
}
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(props: IProps, state: IState) {
|
||||
return { value: props.value || '' }
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
if (this.props.initalValue) {
|
||||
this.setState({
|
||||
@@ -42,6 +38,10 @@ export default class TextInput extends React.Component<IProps, IState> {
|
||||
}
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(props: IProps, state: IState) {
|
||||
return { value: props.value || state.value }
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="TextInputWrapper" style={this.props.style || {}}>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
.NewsContent tbody::-webkit-scrollbar {
|
||||
.NewsContent tbody::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user