Giter VIP home page Giter VIP logo

micro-state-management-with-react-hooks's Introduction

Micro State Management with React Hooks

Micro State Management with React Hooks

This is the code repository for Micro State Management with React Hooks, published by Packt.

Explore custom hooks libraries like Zustand, Jotai, and Valtio to manage global states

What is this book about?

State management is one of the most complex concepts in React. Traditionally, developers have used monolithic state management solutions. Thanks to React Hooks, micro state management is something tuned for moving your application from a monolith to a microservice.

This book covers the following exciting features:

  • Understand micro state management and how you can deal with global state
  • Build libraries using micro state management along with React Hooks
  • Discover how micro approaches are easy using React Hooks
  • Understand the difference between component state and module state
  • Explore several approaches for implementing a global state

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

All of the code is organized into folders. For example, Chapter02.

The code will look like the following:

const Component = () => {
  const [count, setCount] = useState(0);
  return (
    <div>
      {count}
      <button onClick={() => setCount((c) => c + 1)}>
        +1
      </button>
    </div>
  );
};

Following is what you need for this book: If you're a React developer dealing with complex global state management solutions and want to learn how to choose the best alternative based on your requirements, this book is for you. Basic knowledge of JavaScript programming, React Hooks and TypeScript is assumed.

With the following software and hardware list you can run all code files present in the book (Chapter 1-11).

Software and Hardware List

Chapter Software required OS required
1-11 Node 14 Windows, Mac OS X, and Linux (Any)
1-11 React 17/create-react-app 4 google chrome
1-11 ECMAScript 2015/TypeScript 4

Related products

Errata

  • Page 151 (code snippet 3 ,line 1): const Counter = ({ countAtom }) => { should be const Counter = () => {
  • Page 59 (Paragraph 3, line 2): This is because Contexts hold only primitive values. Should be ignored and removed which is wrong explanation of the code.
  • Page 37 (code snippet 3, line 13): console.log(container1.addBase(2)); // shows "3" Should be console.log(container1.addBase(2)); // shows "12".
  • Page 37 (code snippet 3, line 14): console.log(container1.addBase(2)); // shows "12" Should be console.log(container1.addBase(2)); // shows "3".
  • Page 14 (code snippet 1, line 3): onClick={() => { state.count = 1; setState(state); } Should be onClick={() => { state.count = 1; setState(state); }}.
  • Page 21 (code snippet 2, line 2): typeof action === 'function' ? action(prev): prev; Should be typeof action === 'function' ? action(prev): action;.

Get to Know the Author

Daishi Kato is a software engineer who is passionate about open-source software. He had been a researcher on peer-to-peer networks and web technologies for decades. His interest has been in engineering, and he has been working with startups for the last 5 years. He has been actively involved in OSS since the โ€™90s, and his latest work focuses on developing various libraries with JavaScript and React.

micro-state-management-with-react-hooks's People

Contributors

ankitchouhan1020 avatar dai-shi avatar hedwards1997 avatar saurabhk710 avatar wjx0820 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.