warn when component includes one-time reactive declarations

pull/4635/head
pushkin 6 years ago committed by GitHub
parent aa3dcc06d6
commit 54e0bae19d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -402,6 +402,15 @@ export default function dom(
`;
}
if (component.compile_options.dev && fixed_reactive_declarations.length) {
fixed_reactive_declarations.forEach((v) =>
component.warn(v, {
code: "one-time-reactive-declaration",
message: `${component.name.name} includes a one-time reactive declaration, consider making it a part of the static top level statements instead.`,
})
);
}
const return_value = {
type: 'ArrayExpression',
elements: initial_context.map(member => ({

Loading…
Cancel
Save