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)

12 Keyed lists

This chapter covers

  • Working with keyed lists of components
  • Working with keyed lists of elements
  • Updating the application instance
  • Publishing the new version of the framework

Components have internal state. This state is hidden from the outside world—not reflected in the virtual DOM tree that represents the view—and thus can’t be used to compare two component virtual DOM nodes. But to patch the view correctly, you must make sure that when you have a list of components, the reconciliation algorithm can distinguish among them.

Let’s look at an example. Suppose that you have a Counter component with a count state property, which can be initialized with a different value for each component instance:

const Counter = defineComponent({ ...
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