1.19.5 โ€ข Published 6 months ago

react-react v1.19.5

Weekly downloads
24
License
MIT
Repository
github
Last release
6 months ago

react-react ยท GitHub license npm Coveralls github PRs Welcome

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! ๐Ÿ’ป

1.19.4

6 months ago

1.19.5

6 months ago

1.2.0

6 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago