1.19.5 โข Published 6 months ago
react-react v1.19.5
react-react ยท

Impressive state management toolkit for React ๐
Pros
- Easy to use ๐
- Easy to read and maintain ๐
- Full hooks support ๐ช
- React Server Components support ๐
- Easy to get started with ๐
- Fully compatible with React โ๏ธ
- Small size ๐ชถ
- Flow and TypeScript support ๐ป
- 100% test coverage โ
Installation
yarn add react-react
or
npm install react-react
How to use
First, create a component:
import * as React from "react";
class MyComponent extends React.Component {
// ...existing code...
}
To set state, use the setState
function. For example:
foo() {
this.setState({ bar: "value" })
}
Access the state via the state
field:
render() {
return <div>{this.state.bar}</div>
}
To use the library, add the following import at the beginning of your file:
import "react-react";
Usage with hooks
Create a functional component:
import React, { useState } from 'react';
function MyComponent() {
// ...existing code...
}
Add the useState
hook:
function MyComponent() {
const [value, setValue] = useState("value");
return <div>{value}</div>;
}
To update value
, use setValue
:
function foo(newValue) {
setValue(newValue);
}
Conclusion
Now you're ready to manage state like a pro! ๐ Happy coding! ๐ป