0

I have searched enough and skimmed through the documentation of import available on https://developer.mozilla.org/en/docs/web/javascript/reference/statements/import

I still didn't get an answer as to what would be the syntax for:

import React from 'react';
var InfiniteScroll = require('react-infinite-scroll')(React);

I am not sure how to write require('react-infinite-scroll')(React) using import.

Thanks in anticipation.

shet_tayyy
  • 5,366
  • 11
  • 44
  • 82
  • 2
    You are probably looking for something like this: import React from 'react'; import InfiniteScrollCosntructor from 'react-infinite-scroll'; const infiniteScroll = InfiniteScrollCosntructor(React); – Max Brodin Jul 04 '16 at 15:15
  • There's nothing special about it, it's just running a function with argument `React`. – gcampbell Jul 04 '16 at 15:16

1 Answers1

1

You are probably looking for something like this:

import React from 'react'; 
import InfiniteScrollCosntructor from 'react-infinite-scroll'; 
const infiniteScroll = InfiniteScrollCosntructor(React);
Max Brodin
  • 3,903
  • 1
  • 14
  • 23