Skip to content

Functional components are re-rendered when props are unchanged. #4037

Closed
@1player

Description

@1player

Vue.js version

2.0.3

Reproduction Link

https://jsfiddle.net/r4jpy72a/1/

Steps to reproduce

Open the jsfiddle, click the button multiple times.

What is Expected?

Both component not to be re-rendered if the props are not changing.

What is actually happening?

The functional component is re-rendered when the props are unchanged.
The regular component exhibits the expected behaviour.

To optimise and avoid expensive renders in a complex application, I'm moving most of the HTML logic to functional components and expect them not to be re-rendered if the data passed doesn't change.

If this is intended, perhaps the docs should reflect this quirk, but I don't see any reason why we should always call the render function when we can safely assume the resulting HTML to be unchanged (same input == same output).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions