Skip to content

Attrs Fallthrough #625

@zeng450026937

Description

@zeng450026937

Version

3.0.0-alpha.1

Reproduction link

https://codepen.io/itoito-cn/pen/WNbgrdN

Steps to reproduce

import { defineComponent } from 'vue';

export default defineComponent({
  props: ['foo'],
  setup(props, context) {
    return () => [
      h('div', 'content 1'),
      h('div', 'content 2'),
      h('div', context.attrs),
    ];
  },
});

What is expected?

attrs fallthrough should not warn when attrs is used during render

in this scenario, it's better if we also check the access from setupContext to prevent warning.

What is actually happening?

we don't have any approach to prevent warning if an arrow function is returned as render function within setup().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions