Skip to content

Commit

Permalink
fix: use value or defaultValue props for input value
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Jun 18, 2019
1 parent da3b1ad commit b801106
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react/src/components/TextArea/TextArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const TextArea = ({
renderCharCounter: CharCounter = DefaultCharCounter,
...other
}) => {
const [textareaVal, setInput] = useState(defaultValue);
const [textareaVal, setInput] = useState(other.value || defaultValue);
const textareaProps = {
id,
onChange: evt => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const TextInput = React.forwardRef(function TextInput(
},
ref
) {
const [inputVal, setInput] = useState(defaultValue);
const [inputVal, setInput] = useState(other.value || defaultValue);
const errorId = id + '-error-msg';
const textInputClasses = classNames(`${prefix}--text-input`, className, {
[`${prefix}--text-input--light`]: light,
Expand Down

0 comments on commit b801106

Please sign in to comment.