본문 바로가기

REACT

(10)
[React] styled-component 에서 colspan, rowspan 사용하기 import styled from "styled-components"; ............. {data.title} ............. const Title = styled.th` font-size: 30px; `;
[React]WYSIWYG toast-ui editor 사용하기 참고 - npm https://www.npmjs.com/package/@toast-ui/react-editor - api https://nhn.github.io/tui.editor/latest/ToastUIEditor#isViewer 1. 설치 npm install --save @toast-ui/react-editor yarn add @toast-ui/react-editor 2. 선언 import 'codemirror/lib/codemirror.css'; import '@toast-ui/editor/dist/toastui-editor.css'; import { Editor } from '@toast-ui/react-editor'; 3.코드 import React, { Component } from "re..
Axios로 get, post 진행 중 URL에 [object%20Object] 가 찍히는 현상 참조 : https://github.com/axios/axios axios/axios Promise based HTTP client for the browser and node.js - axios/axios github.com Axios.post({'https://openapi.naver.com/v1/papago/n2mt', data, header}) 이런 식으로 진행했는데, Axios.post('https://openapi.naver.com/v1/papago/n2mt', data, header) 로 바꾸니 해당 현상은 사라졌다.
[React]ComponentDidUpdate() 내에서 Setstate 를 사용하는 방법(무한루프 방지) 참조 : https://stackoverflow.com/questions/37937250/componentdidupdate-setstate-reactjs-infinite-loop ComponentDidUpdate SetState ReactJS Infinite loop Even though there are many questions with the same subject line, I could not get an answer for my problem. Problem I have a select dropdown. On click of which, I call an Api which fetches ... stackoverflow.com Setstate 를 사용할 때, 리렌더링됨과 더불어 Component..
[React] React-route 간단정리 1. 설치 npm install --save react-route-dom 혹은 yarn add react-route-dom 2. import import { BrowserRouter as Router, Route } from 'react-router-dom'; 3. 사용
Objects are not valid as a React child (found: [object Promise]). If you meant to render a collection of children, use an array instead 참조 : https://stackoverflow.com/questions/47658765/objects-are-not-valid-as-a-react-child-found-object-promise/47659112 Objects are not valid as a React child (found: [object Promise]) I am trying to render a list of posts by mapping through an array. I've done this many times before but for some renderPosts = async () => { try { let res = await axios.get('/posts')... stackoverflow.com React에서 ax..
React 에서 axios 로 API 요청중 생긴 오류 처음에 Request 로 프론트엔드 단에서 네이버 실검 크롤링을 해보려고 했는데 막힘. -> 기존에 Node.js Express 로 만들어놨던 사이트에서 Restful API 작성 그런데 React 에서 axios 로 API 요청하니 생긴 문제 해결방안 - Chrome 확장앱 Access-control-Allow-origin 받아서 설치. (임시로 한거이므로 수정 예정)
[React]ComponentDidMount() 에 Props 값이 제대로 안들어갈 때 Mobx 에서 정해준 기본값 0. 상위 컴포넌트에서 Geolocation API 로 props값 변경. 해당 컴포넌트에서 console.log(this.props) 했을 때는 변경된 props 값 출력이 되는데 this.props.mylat 을 출력하면 기본값인 0이 나온다. 해결방법 : ComponentDidMount() -> ComponentDidUpdate 로 바꾼다.