官术网_书友最值得收藏!

Selecting data to view

Let's add in some dynamic behavior to our page. We'll make each of the list items a link that the user can click on to view that appointment.

Thinking through our design a little, there are a few pieces we'll need:

  • A button element within our li
  • An onClick handler that is attached to that button element
  • A component state to record which appointment is currently being viewed

When we test React actions, we do it by observing the consequences of those actions. In this case, we can click on a button and then check that its corresponding appointment is now rendered on screen.

主站蜘蛛池模板: 宜城市| 潢川县| 奇台县| 桂阳县| 甘德县| 朔州市| 临城县| 托里县| 泰和县| 荥阳市| 怀柔区| 铜梁县| 分宜县| 遵义市| 安吉县| 大厂| 宾川县| 吉木萨尔县| 孝感市| 濮阳市| 钦州市| 三原县| 肃南| 保靖县| 吉水县| 彭山县| 启东市| 巫山县| 苍南县| 广州市| 伊宁县| 汽车| 昭平县| 西青区| 东安县| 秭归县| 西乌| 五大连池市| 金寨县| 阳西县| 沙田区|