This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function insert(array, rightIndex, value) { | |
for (var j = rightIndex; j >= 0 && array[j] > value; j--) { | |
array[j + 1] = array[j]; | |
} | |
array[j + 1] = value; | |
} | |
function insertionSort(array) { | |
for (var i = 1; i < array.length; i++) { | |
insert(array, i - 1, array[i]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useCallback, forwardRef } from 'react'; | |
import { Input } from 'antd'; | |
import PhoneInput from 'react-phone-number-input/min'; | |
import 'react-phone-number-input/style.css'; | |
const PhoneInputComponent = forwardRef(({ onChange, ...props }, ref) => { | |
const handleChange = useCallback(e => onChange(e.target.value), [onChange]); | |
return <Input ref={ref} {...props} onChange={handleChange} />; | |
}); |