Files
DefinitelyTyped/types/cleave.js/cleave.js-tests.tsx
Rudolph Gottesheim 09bc77ae3d Fix cleave.js (Cleave is a class, not a function) (#23046)
* Fix cleave.js (Cleave is a class, not a function)

See examples at https://github.com/nosir/cleave.js

* Add whitespace
2018-01-19 10:12:29 -08:00

23 lines
593 B
TypeScript

import * as React from "react";
import Cleave = require("cleave.js");
import CleaveReact = require("cleave.js/react");
const Example1 = () => {
const cleave = new Cleave("#my-input", { phone: true });
cleave.setPhoneRegionCode("AT");
cleave.setRawValue("foo");
const foo: string = cleave.getFormattedValue();
const bar: string = cleave.getRawValue();
cleave.destroy();
};
const ExampleReact1 = (props: any) => {
return (
<CleaveReact
value="test"
className="form-control"
options={{ phone: true }}
/>
);
};