Open 7022Andre opened 7 years ago
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.
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?
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.
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 :).