1.0.4 • Published 4 years ago
error-message-tal v1.0.4
Error-Message
this package contains error message components and all country codes component
how to install?
npm
npm i error-message-tal
yarn
yarn add error-message-tal
Few things to keep in mind while using it
The error message can be a
stringor anarray, but the success prop should always be astringIf you are using
classNamethen theerrorStyle/messageStyleprop won't work.
how to use country code component?
import {Country_Code} from 'error-message-tal'
function App() {
return (
<div>
<label>Select Country code</label>
<select
name="Country code"
className="select">
<Country_Code />
</select>
</div>
);
}how to use the error-message component?
import { ErrorMessage } from "error-message-tal";
function App() {
const [success, setSuccess] = useState('yeah! its working');
const [error, seterror] = useState('');
return (
<div>
<ErrorMessage success={success} error={error}/>
</div>
);
}props for error-message component
error, success, errorStyle, messageStyle, errorClass, messageClass,
| props | type | default | required |
|---|---|---|---|
| success | string | string | true |
| error | string/array | array | true |
| errorStyle | Style(obj) | false | |
| messageStyle | Style(obj) | false | |
| errorClass | className(string) | null | false |
| messageClass | className(string) | null | false |