-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Behavior changed in the rendering of primitive values #574
Labels
🐞 bug
Something isn't working
Comments
Does it makes sense to pass anything that isn't a string or an |
@posva of course, here's an example of what I do all the time when writing components in plain JS function render() {
return h('div', [
// isOpen is boolean
props.isOpen && h('div', [])
])
} |
Also Vue 2.6 allows booleans: export interface CreateElement {
(tag?: string | Component<any, any, any, any> | AsyncComponent<any, any, any, any> | (() => Component), children?: VNodeChildren): VNode;
(tag?: string | Component<any, any, any, any> | AsyncComponent<any, any, any, any> | (() => Component), data?: VNodeData, children?: VNodeChildren): VNode;
}
export type VNodeChildren = VNodeChildrenArrayContents | [ScopedSlot] | string | boolean | null | undefined; so removing it would be a breaking change |
Right, booleans make sense for jsx
Eduardo San Martin Morote
… On 3 Jan 2020, at 11:32, Jacek Karczmarczyk ***@***.***> wrote:
Also Vue 2.0 allows booleans:
export interface CreateElement {
(tag?: string | Component<any, any, any, any> | AsyncComponent<any, any, any, any> | (() => Component), children?: VNodeChildren): VNode;
(tag?: string | Component<any, any, any, any> | AsyncComponent<any, any, any, any> | (() => Component), data?: VNodeData, children?: VNodeChildren): VNode;
}
export type VNodeChildren = VNodeChildrenArrayContents | [ScopedSlot] | string | boolean | null | undefined;
so removing it would be a breaking change
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Version
3.0.0-alpha.1
Reproduction link
2.x - https://jsfiddle.net/natuqebm/
3.0.0-alpha.1 - https://jsfiddle.net/u7pt6gjo/
Steps to reproduce
Just open these above reproductions links
What is expected?
There is an inconsistency between Vue 2.x and the latest alpha. 3.x should not render a boolean values in the render function.
What is actually happening?
Renders
0falsetrueNaN
instead of0NaN
The text was updated successfully, but these errors were encountered: