fix: morph/react ignore data slots from view's props #254
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.
With this PR I try to solve this issue where data related slots appear in the view's props as unused variables: #242
I need this change because I'll try to reuse the mechanism for the design tokens, otherwise it will even lead to syntax errors as the design token slots now contain dots as well:
will end up with some code like this:
There could be an edge case issue with the approach, but I'm not expecting it to be a problem at the moment as those
isValid
,onChange
etc. keywords should be used only with data anyway. e.g.This use case will not work with the approach I implemented here, as the slot won't appear in the props. I couldn't think of a better solution, but let me know please if you think this could be problematic and we could dig into that more. Thanks