{"id":15861885,"url":"https://github.com/afeiship/react-upload-self","last_synced_at":"2026-05-03T07:36:17.848Z","repository":{"id":57123021,"uuid":"367543332","full_name":"afeiship/react-upload-self","owner":"afeiship","description":"Upload only one element for react.","archived":false,"fork":false,"pushed_at":"2021-07-06T09:16:48.000Z","size":942,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T00:47:31.619Z","etag":null,"topics":["media","react","self","upload","uploader"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/afeiship.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-15T04:59:44.000Z","updated_at":"2021-07-06T09:16:50.000Z","dependencies_parsed_at":"2022-08-24T14:59:33.166Z","dependency_job_id":null,"html_url":"https://github.com/afeiship/react-upload-self","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Freact-upload-self","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Freact-upload-self/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Freact-upload-self/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Freact-upload-self/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afeiship","download_url":"https://codeload.github.com/afeiship/react-upload-self/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709931,"owners_count":20821297,"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":["media","react","self","upload","uploader"],"created_at":"2024-10-05T22:21:04.948Z","updated_at":"2026-05-03T07:36:12.821Z","avatar_url":"https://github.com/afeiship.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-upload-self\n\u003e Upload only one element for react.\n\n[![version][version-image]][version-url]\n[![license][license-image]][license-url]\n[![size][size-image]][size-url]\n[![download][download-image]][download-url]\n\n## installation\n```shell\nnpm install -S @jswork/react-upload-self\n```\n\n## properties\n| Name      | Type   | Required | Default | Description                           |\n| --------- | ------ | -------- | ------- | ------------------------------------- |\n| className | string | false    | -       | The extended className for component. |\n| value     | string | false    | -       | The runtime image url value.          |\n| onChange  | func   | false    | noop    | The change handler.                   |\n| template  | func   | false    | -       | The uploaded display template.        |\n| toolbar   | func   | false    | -       | Toolbar element.                      |\n\n\n## usage\n1. import css\n  ```scss\n  @import \"~@jswork/react-upload-self/dist/style.css\";\n\n  // or use sass\n  @import \"~@jswork/wsui-frame-wrapper/dist/index.scss\";\n  @import \"~@jswork/wsui-scaleable-image/dist/index.scss\";\n  @import \"~@jswork/react-fade-image/dist/style.scss\";\n  @import \"~@jswork/react-upload-self/dist/style.scss\";\n  \n  \n\n  // customize your styles:\n  $react-upload-self-options: ()\n  ```\n2. import js\n  ```js\n  import ReactDemokit from '@jswork/react-demokit';\n  import React from 'react';\n  import ReactDOM from 'react-dom';\n  import ReactUploadSelf from '@jswork/react-upload-self';\n  import './assets/style.scss';\n\n  class App extends React.Component {\n    state = {\n      v1: 'https://tva1.sinaimg.cn/large/008i3skNgy1gqh868msafj302s02st8l.jpg'\n    };\n\n    render() {\n      const { v1 } = this.state;\n      return (\n        \u003cReactDemokit\n          className=\"p-3 app-container\"\n          url=\"https://github.com/afeiship/react-upload-self\"\u003e\n          \u003cReactUploadSelf\n            value={v1}\n            onChange={(e) =\u003e {\n              console.log('changed.');\n              const { value } = e.target;\n              const { url } = value;\n              if (value.file) {\n                this.setState({ v1: url });\n                setTimeout(() =\u003e {\n                  console.log('fetch image from api:');\n                  this.setState({\n                    v1: 'https://tva1.sinaimg.cn/large/007S8ZIlgy1gexw87htqhj305k05k74o.jpg'\n                  });\n                }, 3000);\n              }\n            }}\n            className=\"mb-5\"\n          /\u003e\n          \u003cReactUploadSelf className=\"mb-5\" /\u003e\n          \u003cReactUploadSelf className=\"mb-5\" /\u003e\n          \u003cReactUploadSelf className=\"mb-5\" /\u003e\n        \u003c/ReactDemokit\u003e\n      );\n    }\n  }\n\n  ReactDOM.render(\u003cApp /\u003e, document.getElementById('app'));\n\n  ```\n\n## documentation\n- https://afeiship.github.io/react-upload-self/\n\n\n## license\nCode released under [the MIT license](https://github.com/afeiship/react-upload-self/blob/master/LICENSE.txt).\n\n[version-image]: https://img.shields.io/npm/v/@jswork/react-upload-self\n[version-url]: https://npmjs.org/package/@jswork/react-upload-self\n\n[license-image]: https://img.shields.io/npm/l/@jswork/react-upload-self\n[license-url]: https://github.com/afeiship/react-upload-self/blob/master/LICENSE.txt\n\n[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/react-upload-self\n[size-url]: https://github.com/afeiship/react-upload-self/blob/master/dist/react-upload-self.min.js\n\n[download-image]: https://img.shields.io/npm/dm/@jswork/react-upload-self\n[download-url]: https://www.npmjs.com/package/@jswork/react-upload-self\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Freact-upload-self","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafeiship%2Freact-upload-self","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Freact-upload-self/lists"}