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