{"id":21009028,"url":"https://github.com/avin/react-flash-change","last_synced_at":"2025-05-15T02:32:54.927Z","repository":{"id":57099979,"uuid":"154696695","full_name":"avin/react-flash-change","owner":"avin","description":"Flash container on change props","archived":false,"fork":false,"pushed_at":"2019-01-06T17:51:25.000Z","size":531,"stargazers_count":12,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-25T05:20:52.452Z","etag":null,"topics":["detect-changes","flash","highlight","react"],"latest_commit_sha":null,"homepage":"https://avin.github.io/react-flash-change","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-25T15:42:44.000Z","updated_at":"2022-04-26T15:19:15.000Z","dependencies_parsed_at":"2022-08-22T23:10:44.162Z","dependency_job_id":null,"html_url":"https://github.com/avin/react-flash-change","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Freact-flash-change","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Freact-flash-change/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Freact-flash-change/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Freact-flash-change/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avin","download_url":"https://codeload.github.com/avin/react-flash-change/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225324104,"owners_count":17456460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["detect-changes","flash","highlight","react"],"created_at":"2024-11-19T09:15:14.857Z","updated_at":"2024-11-19T09:15:15.406Z","avatar_url":"https://github.com/avin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-flash-change\n\n\u003e Flash container on change props\n\n[![NPM registry](https://img.shields.io/npm/v/@avinlab/react-flash-change.svg?style=for-the-badge)](https://yarnpkg.com/en/package/@avinlab/react-flash-change) [![NPM license](https://img.shields.io/badge/license-mit-red.svg?style=for-the-badge)](LICENSE)\n\n## Demo\n\nHere is an [examples page](https://avin.github.io/react-flash-change).\n\nThere are sources in `./storybook`\n\n## Install\n\n```bash\n# Yarn\nyarn add @avinlab/react-flash-change\n\n# NPM\nnpm install --save @avinlab/react-flash-change\n```\n\n## Usage\n\n```js\nimport React from 'react';\nimport FlashChange from '@avinlab/react-flash-change';\n\nconst Component = ({ value }) =\u003e {\n    \u003cFlashChange\n        value={value}\n        flashClassName=\"flashing\"\n        compare={(prevProps, nextProps) =\u003e {\n            return nextProps.value !== prevProps.value;\n        }}\n    \u003e\n        \u003cspan\u003e{value}\u003c/span\u003e\n    \u003c/FlashChange\u003e;\n};\n```\n\n## API\n\n### Props\n\n| Property         | Type              | Required? | Description                                                                                                                                                                                                |\n| :--------------- | :---------------- | :-------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| compare          | Function          |           | Function to compare props before and after update to resolve to flash or not. Function params: `(prevProps, nextProps)`. Default it compares `props.value`. If return string - it will be flash className. |\n| flashDuration    | Number            |           | Duration of \"flash\"-effect in ms. Default: 200ms                                                                                                                                                           |\n| flashClassName   | String            |           | Flash-effect className                                                                                                                                                                                     |\n| flashStyle       | Object            |           | Flash-effect style object                                                                                                                                                                                  |\n| className        | string            |           | Optional custom CSS class name                                                                                                                                                                             |\n| style            | Object            |           | Optional inline style                                                                                                                                                                                      |\n| outerElementType | React$ElementType |           | Tag name passed to document.createElement to create the outer container element. Default: `div`                                                                                                            |\n\n## License\n\nMIT © [avin](https://github.com/avin)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favin%2Freact-flash-change","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favin%2Freact-flash-change","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favin%2Freact-flash-change/lists"}