Skip to content

Conversation

@davidhanenko
Copy link
Contributor

🛠️Closes #38

✔️ Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

📄 Note to reviewers

The following part of the code causes the error. width and height was equal to null during the first render and get some value after window becomes defined.

  const hasWindow = typeof window !== 'undefined';

  function getWindowDimensions() {
    const width = hasWindow ? window.innerWidth : null;
    const height = hasWindow ? window.innerHeight : null;
    return {
      width,
      height,
    };
  }

Fixed with using the useEffect hook and custom debounce function to set 0 timeouts for setting width and height.

📷 Screenshots

@vercel
Copy link

vercel bot commented Apr 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drip-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 21, 2023 11:53am

Copy link

@Aziz-4980 Aziz-4980 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

Comment on lines +8 to +10
const TWITTER_LINK =
'https://twitter.com/intent/tweet?url=https://khazifire.com&text=DripUI%20is%20a%20collection%20of%20free%20Tailwind%20CSS%20components%20that%20can%20be%20used%20in%20your%20next%20project.%20%0A-%20By%20@khazifire%0A';
const GITHUB_LINK = 'https://github.com/khazifire/DripUI';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should be in a secure location

@khazifire khazifire merged commit 9e2a937 into khazifire:main Mar 28, 2024
itsnooshin added a commit to itsnooshin/DripUI that referenced this pull request Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants