Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Code Cleanup #43

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Code Cleanup #43

wants to merge 9 commits into from

Conversation

tikotzky
Copy link
Contributor

Hi,

Thanks for the great lib. I did a cleanup locally and figured I'd push it up so you can see what I did (and if you like it merge it in 😄).

None of the changes I made should alter any of the existing behavior. If you find any differences please let me know.

I did the cleanup in a bunch of steps and annotated each commit with what was changed and why.

Thanks again for the lib and let me know what you think...

since the `timer` variable was being initialized in the `_handleSpy` function it would be a new variable each time it was called so the `if (timer)` check would always fail.
if we set it to an empty string by default we dont need to check if it got passed in.
if the only item in the template string is a variable is then you can just use the variable directly
passing `this.props.className` on to the `Tag` will function the same.
We dont need an extra check to see if its truthy since we want to pass whatever classname they already had straight through
This way we dont need to worry about passing all existing props since cloneElement we keep all existing props and just override props that are passed (in this case just className)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant