-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image hook styled #131
base: master
Are you sure you want to change the base?
Image hook styled #131
Conversation
JoshuaRogan
commented
Oct 2, 2019
•
edited
Loading
edited
- Update readme
- Write tests
- Test code
Click the theme buttons to re-initialize examples. | ||
|
||
```js | ||
<StyledCountdown onTick={value => console.log("Countdown: ", value)} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫
@@ -0,0 +1,101 @@ | |||
import React, { useState } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use React.useState
, let's drop this import
setIsLimbo(true); | ||
}, [src]); | ||
// this is odd but it allows us to quickly flush the src when an image src is swapped but react is able to use | ||
// the same DOM element. The other option would be to use keys but then react can't be as efficient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
a3ec7ed
to
bbce9a6
Compare