Skip to Content
Build a Frontend Web Framework (From Scratch)
book

Build a Frontend Web Framework (From Scratch)

by Angel Sola
May 2024
Beginner to intermediate
384 pages
9h 29m
English
Manning Publications
Content preview from Build a Frontend Web Framework (From Scratch)

11 Subcomponents: Communication via props and events

This chapter covers

  • Adding a new virtual DOM type to represent components
  • Implementing subcomponents
  • Passing data from a parent component to its children using props
  • Communicating among components by using events

What’s the value of a component if it can’t include other components? The Component class that you implemented in chapters 9 and 10 can’t return other components from its render() method; it can return only fragments, elements, or text nodes. But, as you can imagine, building a complex application by using a single component that renders the entire view isn’t very practical.

In this chapter, you learn how to add subcomponents (components inside other components) to your framework ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

React - The Complete Guide (Includes Hooks, React Router, and Redux) - Second Edition

React - The Complete Guide (Includes Hooks, React Router, and Redux) - Second Edition

Academind by Maximilian Schwarzmüller GmbH
Full Stack Testing

Full Stack Testing

Gayathri Mohan

Publisher Resources

ISBN: 9781633438064Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link