Fix react warnings
This commit is contained in:
parent
cef39b2edd
commit
dbed11214d
@ -34,16 +34,6 @@ extends React.PureComponent<TeamEditorProps, TeamEditorState> {
|
||||
getName(team?: Team) {
|
||||
return team ? team.name : ''
|
||||
}
|
||||
componentWillReceiveProps(nextProps: TeamEditorProps) {
|
||||
if (nextProps.type === 'update') {
|
||||
const {team} = nextProps
|
||||
if (team !== (this.props as UpdateTeamProps).team) {
|
||||
this.setState({
|
||||
name: this.getName(team),
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const name = event.target.value
|
||||
this.setState({name})
|
||||
|
||||
@ -69,6 +69,7 @@ export class TeamManager extends React.PureComponent<TeamManagerProps> {
|
||||
<PanelHeading>Edit Team: {team && team.name}</PanelHeading>
|
||||
<PanelBlock isDisplay='block'>
|
||||
{team && <TeamEditor
|
||||
key={team.id}
|
||||
type='update'
|
||||
team={team}
|
||||
onUpdateTeam={this.props.teamActions.update}
|
||||
|
||||
@ -135,9 +135,9 @@ export class TeamUserList extends React.PureComponent<TeamUsersProps> {
|
||||
async componentDidMount() {
|
||||
await this.fetchUsersInTeam(this.props.team.id)
|
||||
}
|
||||
async componentWillReceiveProps(nextProps: TeamUsersProps) {
|
||||
const {team} = nextProps
|
||||
if (team.id !== this.props.team.id) {
|
||||
componentDidUpdate(prevProps: Readonly<TeamUsersProps>) {
|
||||
const {team} = this.props
|
||||
if (team.id !== prevProps.team.id) {
|
||||
this.fetchUsersInTeam(team.id)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user