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 typescript definition #831

Merged
merged 2 commits into from
Jun 17, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ declare namespace RNRF {
jump(props: props): void,
refresh(props: props): void,
focus(props: props): void,
create(scene: Scene, wrapBy?: () => any): Object
create(scene: React.ReactNode, wrapBy?: () => any): Object
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I want to define

create(scene: Scene, wrapBy?: () => any): Object

But, using this definition, I cannot write the following code.

Actions.create(
  <Scene key={"some_key"} />
);

Are there better way?

Copy link
Contributor

Choose a reason for hiding this comment

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

scenehere is extends from React.Component it should works .By the way. are you using typescript with react-native.If so can you provide an online version,I can have a look.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/xirc/react-native-router-flux-sandbox is the example.
'master' branch uses 69e0ab4
'fixed-one' branch uses a545cad

Copy link
Contributor

Choose a reason for hiding this comment

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

I see,you are right.Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem. Thanks 😄

}

export var Actions: RNRFActions;
Expand Down