allenai / pdf-component-library

51 stars 5 forks source link

Header component: use context vars instead of props #25

Closed carolinepaulic closed 3 years ago

carolinepaulic commented 3 years ago

Description

This is a subtask of https://github.com/allenai/scholar/issues/28926 and a continuation of the state management work from https://github.com/allenai/scholar/issues/28332. The goal of this task was to update our new context variables directly from the Header's click handlers instead of passing update functions in as props from Reader.

Changes in this PR:

Reviewer Instructions

This is one of those tasks that got split out from my giant state management PR.

Reworking some of these click handlers to prevent re-renders is part of my cleanup ticket.

Testing Plan

Demo