Skip to content

add TypeScript typings#33

Open
timse wants to merge 2 commits into
gaearon:masterfrom
timse:add-typings
Open

add TypeScript typings#33
timse wants to merge 2 commits into
gaearon:masterfrom
timse:add-typings

Conversation

@timse

@timse timse commented Jul 26, 2016

Copy link
Copy Markdown

adds TypeScript typings

@IRus

IRus commented Oct 31, 2016

Copy link
Copy Markdown

Any progress on merging this? Looks good for me. cc @gaearon

@IRus

IRus commented Nov 22, 2016

Copy link
Copy Markdown

Up.

@janslow

janslow commented Jan 7, 2017

Copy link
Copy Markdown

DocumentTitle isn't the default export (so it should be exported as export = DocumentTitle instead, using a namespace to export the props interface). See the DefinitelyTyped info on this.

> require('react-side-effect')
[Function: withSideEffect]
> require('react-side-effect').default
undefined

@timse

timse commented Jan 7, 2017

Copy link
Copy Markdown
Author

now :)?

@janslow

janslow commented Jan 7, 2017

Copy link
Copy Markdown

LGTM

@syadykin

Copy link
Copy Markdown

rewind() is missing.

@IRus

IRus commented May 31, 2017

Copy link
Copy Markdown

@syadykin @gaearon is missing

@JakeSidSmith JakeSidSmith left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@gaearon could we get this PR merged after these changes? Its' been 2 years...

Comment thread index.d.ts
interface IDocumentTitleProps {
title: string;
}
declare class DocumentTitle extends Component<IDocumentTitleProps, void> {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

void is not valid in newer React types. You should use {} for back and forward compatibility.

Comment thread index.d.ts
@@ -0,0 +1,6 @@
import {Component} from 'react';
interface IDocumentTitleProps {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would rename the interface DocumentTitleProps. It is not recommended to prefix interfaces with I (although its somewhat still up for debate).

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.

5 participants