[TIL] 0228 강아지

IT/TIL(Today I Learnt)|2022. 3. 1. 03:03

Today I Learnt 

 

 

강아지를 입양해왔다.

그래서 공부를못했다. 강아지를 보고있자니, 사료값을 벌기위해 더 열심히 공부해 해야겠다고 생각했다.

 

 

React

 

 

신기한react 세계

userEffect(()=>{console.log("x가 바뀌엇네"),[x]} //x 가바뀔때만실행
userEffect(()=>{()=>{ ///},[]}// 한번만실행

 

=()=>      // implicit return
=()=>{}    // have to write down "return"

https://www.cover-letter-now.com/build-letter

 

Cover Letter Builder

3 Tailor your cover letter with a few clicks for any job

www.cover-letter-now.com

 

더보기

React.

 

7.1 todo App

import { useState, useEffect } from "react"

function App() {

  const [todo, setTodo] = useState("");
  const onClick = (event) => setTodo(event.target.value)
  const [todos, setTodos] = useState([])
  const submmit = (event) => {
    event.preventDefault()

    if (todo === "") {
      return
    }

    setTodos((previousArray) => [todo, ...previousArray])
    setTodo("")
    console.log(todos)
  }

  return (
    <div>
      <h1> My todos</h1>
      <h2> Todos :  {todos.length}</h2>
      <form>
        <input value={todo} onChange={onClick} placeholder="Write your todo"></input>
        <button onClick={submmit}> Add Todo</button>
      </form>

      <hr />
      <ul>
        {todos.map((item, index) => <li key={index}> {item}</li>)}
      </ul>


    </div >
  );
}

export default App;

 

 

coin tracker :

 

import { useState, useEffect } from "react"

function App() {

  const [loading, setLoading] = useState(true)
  const [coin, setCoin] = useState([])



  useEffect(() => {
    fetch("https://api.coinpaprika.com/v1/tickers")
      .then((response) => response.json())
      .then((json) => {
        setCoin(json)
        setLoading(false)
      })
  }, [])

  return (
    <div>
      <h1 > Coin Tracker</h1>
      <h2> {coin.length}</h2>
      <ul>
        {coin.map((item) => <li key={item.id}> {item.name} | {item.symbol}| price : {item.quotes.USD.price} $ </li>)}
      </ul>

      {loading ? <strong>Loading...</strong> : null}
    </div >
  );
}

export default App;

 

 

 

 

RESTful :

 

https://www.interviewbit.com/rest-api-interview-questions/

 

Top REST API Interview Questions and Answers (2022) - InterviewBit

Learn and Practice on almost all coding interview questions asked historically and get referred to the best tech companies

www.interviewbit.com

 

반응형

'IT > TIL(Today I Learnt)' 카테고리의 다른 글

[TIL] 0305 resume update  (0) 2022.03.05
[TIL] 호주 개발자  (5) 2022.03.03
[TIL] 0224  (0) 2022.02.25
[TIL] 0223  (5) 2022.02.23
[TIL] 0222 fullstack developer  (2) 2022.02.23

댓글()