SupremeTechnopriest / react-idle-timer

User activity timer component
https://idletimer.dev
MIT License
1.15k stars 143 forks source link

No basic examples #22

Closed poorpaddy closed 7 years ago

poorpaddy commented 7 years ago

Was looking for examples in the examples directory per the readme.md. Would be nice to see a couple of basic examples showing fire action after XX ms, resetting etc.

SupremeTechnopriest commented 7 years ago

Hey @poorpaddy. The example can be found here https://github.com/SupremeTechnopriest/react-idle-timer/blob/master/src_examples/App.js

If you run the examples, you will get a page where you can what you described here. Just run npm start from this project.

SupremeTechnopriest commented 7 years ago

Looking at the examples again, I need to update them for the latest react. You don't use refs like you used to, but you should be able to get an idea of how to use idle-timer.

GenZai commented 7 years ago

Yes it seems there is a problem with refs. I get this.refs.idleTimer is undefined

poorpaddy commented 7 years ago

Yes, being new to react I wasn't really able to figure it out. Now that I've had a couple weeks of experience I get it. The doc should be updated though and maybe a simple helloworld level of example.