Skip to content

Conversation

@Jessidhia
Copy link

@Jessidhia Jessidhia commented May 18, 2018

Fixes incorrect module augmentation declaration, fixes exporting an undefined name.

The bulk of the change is just a reindent so looking at https://github.com/thebuilder/react-intersection-observer/pull/72/files?w=1 will be easier.

Fixes incorrect module augmentation declaration, fixes exporting an undefined name.
onChange?: (inView: boolean) => void
}

export default Component
Copy link
Author

Choose a reason for hiding this comment

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

This was exporting a value that doesn't exist, making using the component a type error everywhere.

import { RenderProps } from 'react-intersection-observer'
import React = require('react')

declare module 'react-intersection-observer' {
Copy link
Author

Choose a reason for hiding this comment

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

This is already the declaration for a module named react-intersection-observer, there's no need to explicitly declare it.

Also, because there was an import / export outside the declare, this wasn't actually declaring the module but... self-augmenting?

@coveralls
Copy link

Pull Request Test Coverage Report for Build 271

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 94.41%

Totals Coverage Status
Change from base Build 270: 0.0%
Covered Lines: 78
Relevant Lines: 78

💛 - Coveralls

@thebuilder
Copy link
Owner

Looks good! I'm personally using Flow - any ideas for how the project could validate the .d.ts file as part of the build process?

@thebuilder thebuilder merged commit 0991e93 into thebuilder:master May 18, 2018
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