New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@agile-ts/react

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agile-ts/react

Extension to combine Agile with React or React-Native

  • 0.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
decreased by-42.86%
Maintainers
1
Weekly downloads
 
Created
Source
React Integration

Integration for React and React-Native


GitHub License npm version npm minified size npm total downloads

What does this Integration?

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.



Installation
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/coreNPM VersionSupported React versionsSupports hook based components
v0.1.2+v0.1.2+v6+16.8+Yes

Older Versions aren't supported anymore



Documentation

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.



Contribute

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

Maintainability

Keywords

FAQs

Package last updated on 04 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc