Add support for testValue definitions in nested props only #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes the need to defined an empty base
testValue: {}
for object properties. An effect of this change is that object properties will now return an empty object as theirtestValue
, even if it is not defined.We may or may not want to make this change, just suggesting it as defining an empty object as a
testValue
at multiple levels in hashicorp/react-components#154 felt odd.The approach taken here is:
testValue
on an object prop is not explicitly set, then we'll default it to{}
. This way, we don't have to explicitly set the base empty objecttestValue: {}
at every level of a complex object prop.testValue: undefined
on the"object"
prop. This only needs to be done once, at the "top level" of the tree.