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

onChange callback is not triggered #99

Closed
timkraut opened this issue Sep 6, 2018 · 2 comments
Closed

onChange callback is not triggered #99

timkraut opened this issue Sep 6, 2018 · 2 comments

Comments

@timkraut
Copy link

timkraut commented Sep 6, 2018

Hi,

I've been struggling with the onChange callback. The break point detection works fine but the function I pass to onChange is never called.

I use the following code:

function logOnChange() {
  console.log("changed");
}

function App() {
  return (
    <Media query={{ maxWidth: 500 }} onChange={logOnChange}>
      {matches => (matches ? <p>Small</p> : <p>Large</p>)}
    </Media>
  );
}

I've created a Codesandbox to illustrate the issue:
https://codesandbox.io/s/5v82oypykl

Am I doing something wrong or is this broken?

Thanks in advance!

@timkraut timkraut changed the title onChange callback is not triggered onChange callback is not triggered Sep 6, 2018
@edorivai
Copy link
Collaborator

edorivai commented Sep 6, 2018

Hey, the current changes in master haven't been deployed to npm yet. Please follow #98 for progress updates.

@edorivai edorivai closed this as completed Sep 6, 2018
@ImHamzaAnwer
Copy link

I am facing the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants