Challenge: Lift the State Up

Practice what we’ve learned about lifting the state up.

Problem statement

Your project uses the App, Editor, and Preview components. Your task is to lift the content state up from the Editor to the App component and then pass it down to the Editor and Preview components. Besides receiving the content as a prop, the Editor component should also emit an event, so the content state is updated in the parent. You only have to make changes to the Editor.vue and App.vue components.

Challenge

You are provided with a project that comprises App, Editor, and Preview components. Your task is to lift the content state up from the Editor to the App component and then pass it down to both Editor and Preview components. Besides receiving the content as a prop, the Editor component should also emit an event, so the content state is updated in the parent.

You only have to make changes to Editor.vue and App.vue components.

Get hands-on with 1400+ tech skills courses.