1.0.4 • Published 2 years ago

error-message-tal v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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 string or an array, but the success prop should always be a string

  • If you are using className then the errorStyle/messageStyle prop 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,

propstypedefaultrequired
successstringstringtrue
errorstring/arrayarraytrue
errorStyleStyle(obj)false
messageStyleStyle(obj)false
errorClassclassName(string)nullfalse
messageClassclassName(string)nullfalse