Upload File Component with ReactJS

前端 未结 4 1271
面向向阳花
面向向阳花 2020-12-12 10:27

I\'ve been looking everywhere for some help on making a component to help manage uploading files from within React to an endpoint I have setup.

I\'ve tried numerous

4条回答
  •  余生分开走
    2020-12-12 11:18

    I was faced with the task of getting that facebook or gmail-like behavior where your drop target highlights as soon as the user begins dragging a file anywhere over the window. There was no off-the-shelf React drag and drop solution that I could find. So, I made one.

    It is meant to be bare-bones, supplying you with a base to customize and style as your own. It provides many hooks to enable you to do this. But there is also a demo that gives you an example to go off of.

    Check it out: https://www.npmjs.com/package/react-file-drop

    Demo: http://sarink.github.io/react-file-drop/demo/

提交回复
热议问题