리액트 배열을 json으로 분리하기 (react json import)
리액트 전체 링크 FAQ 같은 내용은 웹이 서비스가 되는 도중에 변경될 일이 거의 없다. 따라서 qnaList를 json으로 분리하여 파일로 관리하는 것이 좋다. const qnaList = [ { category: "category1", question: "what is that ? 1", answer: `this is react. 1 1 < 2 hello!! `, }, { category: "category2", question: "what is that ? 2", answer: "this is react. 2", }, { category: "category3", question: "what is that ? 3", answer: "this is react. 3", }, { category: "cat..
2022. 3. 1.
리액트 - FAQ 카테고리 만들기
리액트 전체 링크 아래의 카테고리대로 선택할 수 있게 되었으니, const categories = [ { name: "자주 묻는 질문", value: "all", }, { name: "카테고리 1", value: "category1", }, { name: "카테고리 2", value: "category2", }, { name: "카테고리 3", value: "category3", }, ]; FAQ 목록을 각 카테고리 별로 분류하도록 해보자. const qnaList = [ { category: "category1", question: "what is that ? 1", answer: "this is react. 1", }, { category: "category2", question: "what is t..
2022. 3. 1.
리액트 카테고리 필터 Category Filter
리액트 전체 링크 아래와 같은 카테고리가 있다고 가정하자. name이 실제 웹에서 보이는 문자열이고, 내부적으로는 value로 필터링을 한다. const categories = [ { name : "자주 묻는 질문", value : "all" }, { name : "카테고리 1", value : "category1" }, { name : "카테고리 2", value : "category2" }, { name : "카테고리 3", value : "category3" }, ]; 카테고리는 Q&A, FAQ 등을 분류하기 위해서 사용할 예정이다. const qnalist = [ { category: "category1", question: "what is that ? 1", answer: "this is rea..
2022. 2. 27.