Feature Search State

未關閉 適合新手
#17 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
65/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
javascript, react
領域
frontend

研究方向

開啟 src/Search.js,檢查客戶姓名輸入欄位及其周圍的元件。新增所要求的 searchInput 狀態和輸入處理常式,然後確認輸入內容會更新欄位,並使用 console.log() 記錄輸入的值。

由索引模型根據 Issue 內容生成。

描述

🐂 Size Medium 📅 Week 3 🧩 Feature

Storing the search input in a state

Instructions:

Implement the functionality to search for a customer name given the text typed into the customer name field.

In the src/Search.js file, declare a new state variable named searchInput with the corresponding setter function setSearchInput (hint: use the React function useState). The initial value of the searchInput variable can be an empty string. Add a value property to the <input> tag that is set to the new searchInput state variable.

Create a new function handleSearchInput taking an event parameter. This function should use the setSearchInput function to update the state variable searchInput with what the user typed in the input field. Finally, add a onChange prop to the <input> tag that is set to the function handleSearchInput. Use console.log() to output the value received in the handleSearchInput function.

Hint: Use event.target.value to get the input value.

Test:

  • Given a searchInput
  • When I type in the field
  • Then the value is logged
主要語言
JavaScript
星號
1
分支
28
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

CodeYourFuture/React-Module-Project 的其他 Issue

查看 CodeYourFuture/React-Module-Project 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。