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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this PR concern other interfaces, which accept children as well? Or is there something special about
LinearGradientProps
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the only interface that needed it. Other componens are either not tested for
children
or they may not even support them.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about
RadialGradientProps
, which then uses the same method which alters the children and right now seems to acceptReactElement[]
instead ofReactNode
: https://github.com/react-native-svg/react-native-svg/blob/cf808ae79db788abb7d2c03875a33920df71a3d6/src/elements/RadialGradient.tsx#L44. I am concerned about it since I made a PR with removing theindex.d.ts
files so the types are the same as used in component files, and it is one of the issues I encountered (see e.g. https://github.com/react-native-svg/react-native-svg/pull/1708/files#diff-1981d696a687c364c10179618dc5edf0feb68bbfa395f99c59b53e289845eec0R299 where I had to provide such type forchildren
in order for the correct input to theextractGradient
function).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's a concern, please open a PR that adds new tests. Then I can check if we need to do anything to work with no implicit children.
The changes in this PR are the only changes required to make the current tests pass when working without implicit children. If the implementation relies on
children
then tests should reflect that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that this is not a DT repo.
I'm not sure I understand what the issue is here. If there's more there needs to be done, why does this block this particular PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just curious why there was a change for this particular component, but if it is for the tests in DT repo, then it makes sense. Could you also point to the test files concerning this change? I think it could be merged, but I think it would be consistent if
ReactNode
inLinearGradientProps
was changed toReactElement[]
.