fix derived state

This commit is contained in:
SpikeHD
2022-06-03 17:57:26 -07:00
parent 1ac4fd5a63
commit 97b2f8a616
2 changed files with 6 additions and 6 deletions

View File

@@ -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() { async componentDidMount() {
if (this.props.initalValue) { if (this.props.initalValue) {
this.setState({ 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() { render() {
return ( return (
<div className="TextInputWrapper" style={this.props.style || {}}> <div className="TextInputWrapper" style={this.props.style || {}}>

View File

@@ -65,7 +65,7 @@
scrollbar-width: none; scrollbar-width: none;
} }
.NewsContent tbody::-webkit-scrollbar { .NewsContent tbody::-webkit-scrollbar {
display: none; display: none;
} }