1.0.1 • Published 3 years ago

notification-panfilov v1.0.1

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

Description

React component that processes a form, its events and elements.

Installation

npm i --save form-panfilov

Testing

For testing, a bunch of jest and the testing library is used. To run the tests, type the following command

npm test

or command to restart the tests after they are changed

npm test:watch

Example and development

In the rollup folder in the terminal, enter the following command to create a link to the local npm package.

npm link

In the same folder, you need to create a link to react and react-dom.

Link to react

npm link ..\defaultReact\node_modules\react

Link to react-dom

npm link ..\defaultReact\node_modules\react-dom

After that, go to the defaultReact folder and run the project with the command

npm link start

Using

Key component of the notification. Wrappers for notification message.

<NotificationList><App/></NotificationList>

Wrapper component for form fields

<FormWrapper errors={errors} form={defaultValue}>
    fields form
<FormWrapper/>

Hooks for create message.

const {addNotification, deleteNotification, notifications} = useNotification

addNotification - function for create notification. deleteNotification - function for delete notification. notifications - list notifications.

NotificationInterface - interface notification.

constsNotification - consts for set type notification.