Skip to content

Hot relaod does not work in functional component ,How to fix it? #11849

@jackchoumine

Description

@jackchoumine

Version

2.6.11

Reproduction link

https://codesandbox.io/s/brave-field-m1quc?file=/src/App.vue

Steps to reproduce

A functional component in script with render.
Hello.vue

<script>
 export default {
   name:'Hello',
   functional:true,
   render(){
     return <h1>
              Does hot reload with functional:true  in script and render?Noo
              </h1>
   }
 }
</script>

The component does not hot reload when I change something in render.

But this does hot reload:
Hi.js

export default {
	name: 'Hi',
	functional: true,
	render(h, { props }) {
		const children = [h('h'   props.level, '这是标题'   props.level)]
		return h('div', children)
	},
}

How to fix it?

What is expected?

I want all components can hot reload.

What is actually happening?

I have to reload page by hand when Hello.vue componet changed.


you can get this repo:
https://github.com/jackchoumine/vue-demo

you change Hello.vue . It does not hot reload.

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