Skip to content
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

fix(useMeasure): allow null element #1451

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

veloek
Copy link

@veloek veloek commented Aug 20, 2020

Description

With strictNullChecks enabled in typescript UseMeasureRef complains
that it's being passed something that may be null.

It's already checking for nulls with if (!element) return;, so it
should be no problem changing the type to allow it.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as before)

Checklist

  • Read the Contributing Guide
  • Perform a code self-review
  • Comment the code, particularly in hard-to-understand areas
  • Add documentation
  • Add hook's story at Storybook
  • Cover changes with tests
  • Ensure the test suite passes (yarn test)
  • Provide 100% tests coverage
  • Make sure code lints (yarn lint). Fix it with yarn lint:fix in case of failure.
  • Make sure types are fine (yarn lint:types).

With strictNullChecks enabled in typescript `UseMeasureRef` complains
that it's being passed something that may be null.

It's already checking for nulls with `if (!element) return;`, so it
should be no problem changing the type to allow it.
@veloek veloek mentioned this pull request Sep 23, 2022
13 tasks
@veloek
Copy link
Author

veloek commented Sep 23, 2022

@streamich This has been open for a while now... Are there any blockers or could it get merged soon?

@axelboc
Copy link

axelboc commented Sep 23, 2022

I'd give up on this one if I were you 😢 #1974

image

I've been using https://react-hookz.github.io/web/?path=/docs/sensor-usemeasure--example for a while now, and it works like a charm 😉

@veloek
Copy link
Author

veloek commented Sep 23, 2022

Yeah, I just got caught up on the discussion about forking/starting over with react-hookz/web and I see that this project is a dead end. I'll see if I can find some time to migrate then...

@MeteorsLiu
Copy link

Thanks to resolve it, same issue for me too.

It seems that the author may not want to maintain it...

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