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

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.

主站蜘蛛池模板: 绵竹市| 晋江市| 大冶市| 大关县| 九龙县| 商水县| 江门市| 温州市| 清苑县| 佛坪县| 安福县| 霍城县| 泗洪县| 天峨县| 高阳县| 海盐县| 邻水| 沁源县| 乳源| 赫章县| 石林| 富锦市| 金堂县| 昌江| 临洮县| 扶余县| 兰溪市| 三河市| 双桥区| 靖宇县| 睢宁县| 福州市| 宾阳县| 永兴县| 克山县| 葫芦岛市| 布拖县| 宁南县| 太仓市| 宾川县| 合江县|