mirror of
https://github.com/kusti8/proton-native.git
synced 2026-05-15 14:15:50 -06:00
fix notepad example (#32)
This commit is contained in:
parent
9b8e064bfa
commit
cdcb5564a4
1 changed files with 5 additions and 5 deletions
|
|
@ -22,7 +22,7 @@ class Notepad extends Component {
|
|||
shouldComponentUpdate(nextProps, nextState) {
|
||||
if(typeof nextState.text === 'string')
|
||||
return false // nextState is set from input
|
||||
else
|
||||
else
|
||||
return true // nextState is set from file
|
||||
}
|
||||
|
||||
|
|
@ -30,12 +30,12 @@ class Notepad extends Component {
|
|||
return (
|
||||
<App>
|
||||
<Menu label="File">
|
||||
<Menu.Item type="Item" onClicked={() => this.open()}>Open</Menu.Item>
|
||||
<Menu.Item type="Item" onClicked={() => this.save()}>Save</Menu.Item>
|
||||
<Menu.Item type="Item" onClick={() => this.open()}>Open</Menu.Item>
|
||||
<Menu.Item type="Item" onClick={() => this.save()}>Save</Menu.Item>
|
||||
</Menu>
|
||||
<Window title="Notes" size={{w: 500, h: 500}}>
|
||||
<Box>
|
||||
<TextInput onChanged={text => this.setState({text})} multiline={true}>{this.state.text}</TextInput>
|
||||
<TextInput onChange={text => this.setState({text})} multiline={true}>{this.state.text}</TextInput>
|
||||
</Box>
|
||||
</Window>
|
||||
</App>
|
||||
|
|
@ -43,4 +43,4 @@ class Notepad extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
render(<Notepad />);
|
||||
render(<Notepad />);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue