Saturday 10 June 2017

How to include "redux-file-upload" in my React App

I have found this redux-file-upload called upload.js

import { FileUpload } from 'redux-file-upload'

<FileUpload

allowedFileTypes={['jpg', 'pdf']}
  data=
  dropzoneId="fileUpload"
  url="./uploads/"
>
  <button>
    Click or drag here
  </button>
</FileUpload>

and I want to use it in React. this file is called Tab5.js :

import React from 'react';
import './../css/bootstrap.css';
import './../css/styles.css';
import Modale from './modalProces';


class Tab5 extends React.Component {
    render () {
        return (
            <div>
                <FileUpload />
            </div>
        );
    }
}
 export default Tab5;

but whenever I run it, Tab5 doesn't show up.

I already installed:
-npm install --save redux
-npm install --save react-redux
-npm install --save-dev redux-devtools
-npm install --save redux-file-upload

Am I missing any imports? Am I doing the whole thing wrong?
I'm not used to coding in React, but I'm forced to do this part.
I just need the file upload to work, where it uploads a file into the uploads folder.

Please Help me.



via sventastic

No comments:

Post a Comment