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

V7 #1079

Merged
merged 63 commits into from Apr 1, 2019

Conversation

@tannerlinsley
Copy link
Collaborator

commented Mar 27, 2019

Changelog

@buzinas

This comment was marked as outdated.

Copy link
Contributor

commented on packages/react-static/src/browser/hooks/usePrefetch.js in 9b944ed Mar 1, 2019

How about creating the ref here instead of expecting it to be passed? Eg:

export const usePrefetch = path => {
  const ref = useRef()

  useEffect(
    () => {
      if (!ref.current) {
        return
      }
      onVisible(ref.current, () => prefetch(getRoutePath(path)))
    },
    [ref.current, path]
  )

  return ref
}

Then the usage would be simpler, eg:

export default () => {
  const elRef = usePrefetch('/blog')
  return (
    <Link to="/blog" ref={elRef}>
      Go to blog
    </Link>
  )
}

(By the way, do you plan to publish an alpha/beta version of v7 anytime soon?)

This comment was marked as outdated.

Copy link
Collaborator Author

replied Mar 1, 2019

This comment was marked as outdated.

Copy link
Collaborator Author

replied Mar 1, 2019

This comment was marked as outdated.

Copy link
Contributor

replied Mar 3, 2019

Thank you! Please, let me know if there is anything I can do to help you with releasing an alpha :)

@tannerlinsley tannerlinsley requested a review from lottamus Mar 27, 2019

tannerlinsley added some commits Mar 28, 2019

Add react-static/node.getWebpackConfig function
This is a port of the changes made in #1064 to v7.

@tannerlinsley tannerlinsley merged commit 18191c8 into master Apr 1, 2019

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.