Coder Social home page Coder Social logo

reactpractice's Introduction

혼자서 투두리스트 만들어보기

링크 : https://yehoonn.github.io/ReactPractice/

책의 내용을 학습한 후 내가 가지고 있는 지식으로만 투두리스트를 만들어보고 있다

오류가나거나 막히는 부분에선 최대한 혼자 고민하면서 풀어보고

도저히 모르겠다 싶을땐 책을 보거나 구글링을 통해 해결방법을 찾고 있다

아이템 생성, 수정, 삭제 기능을 구현했다

막히거나 오래걸렸던 부분

데이터를 기반으로 map함수를 이용하여 태그를 그리는 방식을 사용하지 않고 concat으로 직접 태그를
작성해서 추가시켜보니 관리하는 부분에서 정상적으로 작동하지 않았다 (filter 작동이 정상적이지 않음)

=> 전체적인 코드를 수정하여 아이템이 생성될땐 state에 데이터만 추가되고 (id,text)

=> 이 추가된 데이터를 바탕으로 map함수를 이용해 태그를 그려냈다 (수정 후 filter는 정상적으로 작동)

컴포넌트를 모듈화 시키는 과정에서 자식 컴포넌트가 부모의 함수나 state를 어떻게 사용하는지에 대한 고민

=> 부모가 자식 컴포넌트를 호출할때 인자로 넘겨주면 자식 컴포넌트에서 사용이 가능했다

=> ex) const Parent = () => { [args,setArgs] = useState(); return (<> <ChildrenComponent arg={arg}/> </>) }

=> ex) const ChildrenComponent = (arg) => { return <div>{arg}</div> }

reactpractice's People

Contributors

yehoonn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.