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

rn-code-input

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rn-code-input - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

dist/rn-code-input.d.ts
import React from "react";
import { RNCodeInputProps } from "./types";
declare const RnCodeInput: ({ onChange, value, length, showSoftInputOnFocus, style, ...props }: RNCodeInputProps) => React.JSX.Element;
declare const RnCodeInput: ({ onChange, value, length, showSoftInputOnFocus, style, inputProps, ...props }: RNCodeInputProps) => React.JSX.Element;
export default RnCodeInput;
import React from "react";
import { TextInput, View, Text } from "react-native";
import styles from "./style";
const RnCodeInput = ({ onChange, value, length = 6, showSoftInputOnFocus = false, style, ...props }) => {
const RnCodeInput = ({ onChange, value, length = 6, showSoftInputOnFocus = false, style, inputProps, ...props }) => {
const getValue = React.useCallback((index) => value[index] || "", [value]);
return (React.createElement(View, { style: [styles.container, style] },
Array.from({ length }).map((_, index) => (React.createElement(CodeBox, { key: index, index: index, value: getValue(index), values: value, ...props }))),
React.createElement(TextInput, { keyboardType: "number-pad", style: styles.input, showSoftInputOnFocus: showSoftInputOnFocus, onChangeText: onChange, value: value, maxLength: length })));
React.createElement(TextInput, { keyboardType: "number-pad", style: styles.input, showSoftInputOnFocus: showSoftInputOnFocus, onChangeText: onChange, value: value, maxLength: length, ...inputProps })));
};

@@ -10,0 +10,0 @@ export default RnCodeInput;

@@ -1,2 +0,2 @@

import { TextStyle, ViewStyle } from "react-native";
import { TextInputProps, TextStyle, ViewStyle } from "react-native";
export interface RNCodeInputProps {

@@ -15,2 +15,3 @@ value: string;

style?: ViewStyle;
inputProps?: Partial<Omit<TextInputProps, "onChange" | "value" | "maxLength">>;
}

@@ -17,0 +18,0 @@ export interface CodeBoxProps extends Partial<RNCodeInputProps> {

{
"name": "rn-code-input",
"version": "0.0.3",
"version": "0.0.4",
"description": "React-Native Code input implementation",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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