-
-
Notifications
You must be signed in to change notification settings - Fork 396
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
Add warning when using a function value inside a function rule #1285
Conversation
@@ -55,6 +56,13 @@ export default function functionPlugin() { | |||
// Empty object will remove all currently defined props | |||
// in case function rule returns a falsy value. | |||
styleRule.style = fnRule(data) || {} | |||
|
|||
for (const prop in styleRule.style) { |
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 could avoid doing these checks in production by wrapping it in if (process.env.NODE_ENV === 'development')
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.
Then we could even avoid warning package and use only console.warn
.
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 would keep warning for consistency, but it doesn't matter technically, just in case in the future we want to replace warning, it will be easier if it's used consistently
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.
Just one thing otherwise looks good 👍
@kof updated! I had to change |
LGTM, thank you! |
released in 10.1.0 |
Corresponding issue (if exists):
#1057
What would you like to add/fix?
Add warning when user tries to use a function value inside a function rule.
Todo