Giter Club home page Giter Club logo

react-nodebird's People

Contributors

yomae avatar

Watchers

 avatar

react-nodebird's Issues

[Remind] ch1

왜 인라인 스타일 코드를 지양해야 하는가?

  • 예를 들면 <div style={{marginTop: 10}}> 에서 {} 객체 부분이 리렌더링 시에 다르다고 인지함 ( {} === {} -> false )
  • 해당 스타일 코드가 바뀌지 않아도 계속 실행이 되므로 최적화가 되지 않음.
  • Styled-Components를 사용하거나, useMemo를 사용하여 캐싱하자.
  • useMemo 예 -> const style = useMemo(() => ( {marginTop: 10} ), [] );

useCallback - 함수를 캐싱, useMemo - 값을 캐싱

Custom Hooks

  • 특히나 폼 같은 곳에서 반복적으로 많이 사용하는 것들을 편리하게 묶어보자.
export default (initValue = null) => {
  const [value, setValue] = useState(initValue);

  const handler = useCallback((e) => {
    setValue(e.target.value);
  }, []);

  return [value, handler];
};

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.