react-countdown-clock icon indicating copy to clipboard operation
react-countdown-clock copied to clipboard

Add import command

Open 7022Andre opened this issue 7 years ago • 3 comments

This line (import ReactCountdownClock from 'react-countdown-clock';) needs to be added to the component where you want to use the countdown (most likely at the top of the component). I added it to this readme because some developers might not know how to import it (like me :).

7022Andre avatar Sep 12 '17 03:09 7022Andre

I think I was being vague as I do not know what module system the consuming code is using; Node require vs. ES6 import. I suppose it would be best to give an example in both. At times like this I generally look at other react modules, to see how they would document this.

pughpugh avatar Sep 12 '17 08:09 pughpugh

I looked at other GitHub react repos and they either list require or import but I think using import is getting to be more common (with ES6 as the "new" JS version and being used in newer react versions). Do you think var ReactCountdownClock = require('react-countdown-clock'); should still be added to the readme?

7022Andre avatar Sep 12 '17 19:09 7022Andre

I think having the import statement (in any one form) in the readme file would help the users and avoid wasting time guessing the import statement.

I had to go to this pull request to know the proper import statement.

abhijit-Amne avatar Jan 30 '18 21:01 abhijit-Amne