Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@flywire/react-hooks

Package Overview
Dependencies
Maintainers
6
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flywire/react-hooks - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6-0

13

.babelrc.js
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
modules: 'commonjs',
},
],
'@babel/preset-react',
],
presets: ['@babel/preset-env', '@babel/preset-react'],
};

4

package.json
{
"name": "@flywire/react-hooks",
"version": "0.0.5",
"version": "0.0.6-0",
"description": "A collection of Reacts hooks used in Flywire",

@@ -48,3 +48,3 @@ "main": "src/index.js",

},
"peerDependencies": {
"dependencies": {
"react": "^16.13.1",

@@ -51,0 +51,0 @@ "react-dom": "^16.13.1"

@@ -29,9 +29,24 @@ # useForm

import React from 'react';
import { useToggle } from '@flywire/react-hooks';
import { useForm } from '@flywire/react-hooks';
function App() {
const [on, toggle] = useToggle();
const { values, handleChange, dirtyValues } = useForm();
return <button onClick={toggle}>{on ? 'ON' : 'OFF'}</button>;
function handleSubmit(evt) {
evt.preventDefault();
}
function handleInputChange(evt) {
handleChange(evt.target.name, evt.target.value);
}
return (
<form onSubmit={handleSubmit}>
<input name="firstname" onChange={handleInputChange} />
{!values.firstName && dirtyValues.firstName && 'First name is required.'}
<input type="submit" />
</form>
);
}
```

@@ -24,1 +24,14 @@ # useToggle

| Function to update the state |
#### Usage
```jsx harmony
import React from 'react';
import { useToggle } from '@flywire/react-hooks';
function App() {
const [on, toggle] = useToggle();
return <button onClick={toggle}>{on ? 'ON' : 'OFF'}</button>;
}
```
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