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

react-native-toggle-element

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-toggle-element - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

.circleci/config.yml

4

package.json
{
"name": "react-native-toggle-element",
"version": "1.0.0",
"version": "1.0.1",
"description": "Switch toggle component for React Native. You can add title, icon, modify component for toggle button.",

@@ -39,2 +39,2 @@ "main": "src/index.js",

}
}
}

@@ -1,6 +0,6 @@

# React-Native-Toggle-Element
# React-Native-Toggle-Element [![CircleCI](https://circleci.com/gh/mymai91/react-native-toggle-element.svg?style=svg)](https://circleci.com/gh/mymai91/react-native-toggle-element)
![ezgif com-video-to-gif (7)](https://user-images.githubusercontent.com/6791942/80718297-8edea800-8b2c-11ea-8f69-c7c3f98ca545.gif)
![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6791942/80716998-eb40c800-8b2a-11ea-9350-fa3c2ec6ee40.gif)
![toggle](https://user-images.githubusercontent.com/6791942/80785013-854b5380-8bb1-11ea-9c7a-8b8975381642.gif)

@@ -121,3 +121,3 @@ ## Installation

![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6791942/80716998-eb40c800-8b2a-11ea-9350-fa3c2ec6ee40.gif)
![toggle](https://user-images.githubusercontent.com/6791942/80785013-854b5380-8bb1-11ea-9c7a-8b8975381642.gif)

@@ -124,0 +124,0 @@ ```jsx

@@ -376,3 +376,3 @@ import * as React from 'react';

expect(setToggleValue).toHaveBeenCalledTimes(1);
expect(setToggleValue).toHaveBeenCalledTimes(2);

@@ -403,3 +403,3 @@ fireEvent.press(getByTestId('ToggleButton'));

expect(setToggleValue).toHaveBeenCalledTimes(1);
expect(setToggleValue).toHaveBeenCalledTimes(2);
});

@@ -406,0 +406,0 @@ });

import PropTypes from 'prop-types';
import React, { useRef, useState } from 'react';
import React, { useRef, useState, useEffect } from 'react';
import {

@@ -111,2 +111,3 @@ Animated,

rightTitle,
animationDuration
} = props;

@@ -116,2 +117,10 @@

useEffect(() => {
updateThumbButton(toggleValue)
}, [toggleValue])
useEffect(() => {
setToggleValue(value);
}, [value])
const updateThumbButton = (toggleState) => {

@@ -125,3 +134,3 @@ const thumbBtnWidth = thumbButton.width ?? SIZE_DEFAULT.thumbBtnWidth;

toValue,
duration: 350,
duration: animationDuration,
useNativeDriver: true,

@@ -136,3 +145,2 @@ }).start();

onPress(val);
updateThumbButton(val);
};

@@ -297,2 +305,3 @@

rightTitle: PropTypes.string,
animationDuration: PropTypes.number
};

@@ -336,2 +345,3 @@

thumbStyle: null,
animationDuration: 350
};

@@ -391,2 +401,2 @@

export default ReactNativeToggleElement;
export default ReactNativeToggleElement;
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