-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: removal of default prop values #163
Conversation
- added workaround
commit: |
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.
Thanks @Tinoooo left a couple of comments before merging
offset: () => new Vector2(0.01, 0.01), | ||
radialModulation: false, | ||
modulationOffset: 0.15, | ||
radialModulation: undefined, |
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.
why do we set it to undefined here? Wouldn't be better not to use withDefaults
here @Tinoooo ?
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.
We have to set it to undefined to prevent Vue from casting it to boolean when the prop is not in use. Without this line, we have no chance to find out whether the prop was actively set or not.
@@ -16,8 +17,7 @@ export interface NoisePmndrsProps { | |||
|
|||
<script lang="ts" setup> | |||
const props = withDefaults(defineProps<NoisePmndrsProps>(), { | |||
premultiply: false, | |||
blendFunction: BlendFunction.SCREEN, | |||
premultiply: undefined, |
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.
same here, wouldn't be better to remove the withDefault all along?
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.
We have to set it to undefined to prevent Vue from casting it to boolean when the prop is not in use. Without this line, we have no chance to find out whether the prop was actively set or not.
….com/Tresjs/post-processing into chore/removal-of-default-prop-values
To enable the prop watcher helper to retrieve default constructor values from plain effects, we must not set default values in the effect component's props ourselves. This MR removes the default values from the prop definitions in the affected effects.