Skip to content

Commit

Permalink
[components] Set value to empty string on no value to fix react warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Oct 6, 2020
1 parent 85aad1b commit 412522f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/@sanity/components/src/textinputs/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default class DefaultTextInput extends React.PureComponent<DefaultTextInp
// eslint-disable-next-line @typescript-eslint/no-unused-vars
focusPath,
inputId = '',
value = '',
...restProps
} = this.props

Expand All @@ -73,6 +74,7 @@ export default class DefaultTextInput extends React.PureComponent<DefaultTextInp
>
<input
{...restProps}
value={value}
id={inputId}
ref={this.setInput}
className={classNames(styles.input)}
Expand Down

0 comments on commit 412522f

Please sign in to comment.