Fix View title editing with board change

This commit is contained in:
Chen-I Lim 2020-10-27 14:36:07 -07:00
parent c333c25bd5
commit 0b34ed8015
3 changed files with 8 additions and 12 deletions

View File

@ -128,7 +128,10 @@ class BoardComponent extends React.Component<Props, State> {
</RootPortal>}
<div className='octo-frame'>
<ViewTitle board={board}/>
<ViewTitle
key={board.id + board.title}
board={board}
/>
<div className='octo-board'>
<ViewHeader

View File

@ -71,7 +71,10 @@ class TableComponent extends React.Component<Props, State> {
/>
</RootPortal>}
<div className='octo-frame'>
<ViewTitle board={board}/>
<ViewTitle
key={board.id + board.title}
board={board}
/>
<div className='octo-table'>
<ViewHeader

View File

@ -28,16 +28,6 @@ class ViewTitle extends React.Component<Props, State> {
return true
}
static getDerivedStateFromProps(nextProps: Props, prevState: State) {
if (prevState.title !== nextProps.board.title) {
return {
title: nextProps.board.title,
}
}
return null
}
constructor(props: Props) {
super(props)
this.state = {title: props.board.title}