# Recoil State Management for React

**URL:** <https://forum.kirupa.com/t/recoil-state-management-for-react/644135>\
**Category:** web dev\
**Created:** [September 10, 2020, 2:38pm UTC](https://forum.kirupa.com/t/recoil-state-management-for-react/644135 "2020-09-10T14:38:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [September 10, 2020, 2:38pm UTC](https://forum.kirupa.com/t/recoil-state-management-for-react/644135/1 "2020-09-10T14:38:14Z")

</div>

Recoil is the hot, new (experimental) state management library coming out of Facebook for React.

> **[Recoil](https://recoiljs.org/)**
>
> A state management library for React.

Makes it easy to efficiently share state update across components using a useState-like Recoil hook. Example (partial) from [Getting Started](https://recoiljs.org/docs/introduction/getting-started):

```javascript
const textState = atom({ // <- Recoil state atom (unit of state data)
  key: 'textState', // unique ID (with respect to other atoms/selectors)
  default: '', // default value (aka initial value)
});

function TextInput() {
  const [text, setText] = useRecoilState(textState); // <- Recoil state hook

  const onChange = (event) => {
    setText(event.target.value);
  };

  return (
    <div>
      <input type="text" value={text} onChange={onChange} />
      <br />
      Echo: {text}
    </div>
  );
}

```
