npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@agile-ts/react

v0.2.4

Published

Extension to combine Agile with React or React-Native

Downloads

96

Readme

Integration for React and React-Native

The react package is a set of utilities that simplifies the way AgileTs is integrated into a React environment. Think of it as an extension of AgileTs in the context of React that serves as an interface to React Components. The main task of the react integration is to bind AgileTs States to React Components. This ensures that AgileTs will re-render the Component when the bound State changes. It also provides some other valuable functionalities that optimize the workflow with AgileTs in a React project.

A distinction is made between Functional and Class Components. As we prefer to use React Hooks in Functional Components, however, Hooks aren't supported in Class Components. Therefore, we have created alternatives for Class Components in order to offer the most essential functionalities there as well.

🐆 Functional Component

In Functional Components we recommend using AgileTs Hooks like useAgile(). The useAgile() Hook binds Agile Sub Instances (like States or Collections) to React Components for reactivity.

// -- MyComponent.jsx ------------------------------------------

// Binds MY_FIRST_STATE to 'MyComponent.jsx' for reactivity
const myFirstState = useAgile(MY_FIRST_STATE);

To find out more about useAgile(), and other Hooks provided by AgileTs, checkout the AgileTs Hook documentation.

🦖 Class Component

For Class Components, we provide the AgileHOC. The AgileHOC is a Higher Order Component that is wrapped around a React Component. It takes care of binding Agile Sub Instances (like States or Collections) to the wrapped React Components for reactivity.

// -- MyComponent.jsx ------------------------------------------

// Binds MY_FIRST_STATE to 'MyComponent.jsx' for reactivyty
export default AgileHOC(myComponent, [MY_FIRST_STATE]);

To find out more about the AgileHOC and how to correctly use AgileTs in Class Components, take a look at the AgileHOC documentation.

npm install @agile-ts/react

The react package is an extension of AgileTs and doesn't work without the core package, which functions as the brain of AgileTs and is indispensable. Unfortunately, we can't combine each core with react version. Therefore, we have created a table that shows which versions fit together without restrictions.

| @agile-ts/react | @agile-ts/core | NPM Version | Supported React versions | Supports hook based components | | ---------------- | ----------------------- | ------------------------ | -------------------------|---------------------------------- | | v0.1.2+ | v0.1.2+ | v6+ | 16.8+ | Yes |

Older Versions aren't supported anymore

Sounds AgileTs interesting to you? Checkout our documentation, to learn more. And I promise you, you will be able to use AgileTs in no time. If you have any further questions, don't hesitate to join our Community Discord.

Get a part of AgileTs and start contributing. We welcome any meaningful contribution. 😀 To find out more about contributing, check out the CONTRIBUTING.md.