@samitouri / QOS-React-2 / commits / 290e8c6926

Fixed null input value. Tweaked useReducer test harness.

Brian Vaughn committed Feb 21, 2019 at 13:40 UTC 290e8c69265eada53fa3315903ab6fda82b0c8ce
2 files changed +5 -4
shells/dev/app/EditableProps/EditableProps.js
+4 -3
@@ -47,9 +47,10 @@ function StatefulFunction({ name }: StatefulFunctionProps) {
47 </button>
48 </li>
49 <li>
50 - <button onClick={handleUpdateReducerClick}>
51 - Reducer state: {JSON.stringify(data, null, 2)}
52 - </button>
50 + Reducer state: foo "{data.foo}", bar "{data.bar}"
51 + </li>
52 + <li>
53 + <button onClick={handleUpdateReducerClick}>Swap reducer values</button>
54 </li>
55 </Fragment>
56 );
src/devtools/views/InspectedElementTree.js
+1 -1
@@ -221,7 +221,7 @@ export function EditableValue({
221 type = 'number';
222 }
223
224 - let inputValue = value;
224 + let inputValue = value == null ? '' : value;
225 if (hasPendingChanges) {
226 inputValue = editableValue == null ? '' : editableValue;
227 }