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: Fix useAnimatedSensor return type #3094

Merged
merged 3 commits into from Apr 12, 2022

Conversation

mrousavy
Copy link
Contributor

It returns any now.

@mrousavy
Copy link
Contributor Author

cc @jakub-gonet @piaskowyk

@@ -501,10 +501,19 @@ declare module 'react-native-reanimated' {
interval: number;
};

export type AnimatedSensor = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason it's using a type rather than an interface?

sensor: SensorValue3D | SensorValueRotation | null;
unregister: () => void;
isAvailable: boolean;
config: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be using the type defined above

Suggested change
config: {
config: SensorConfig

@mrousavy
Copy link
Contributor Author

mrousavy commented Apr 7, 2022

@jeremybarbet I used exactly the same type decl as the internal file already uses. Ideally we want to keep both the same or have a single source of truth for it

@piaskowyk piaskowyk self-assigned this Apr 11, 2022
@piaskowyk piaskowyk self-requested a review April 11, 2022 19:58
Copy link
Member

@piaskowyk piaskowyk left a comment

Choose a reason for hiding this comment

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

Thanks for the help Marc ❤️

@piaskowyk piaskowyk merged commit f0165b2 into software-mansion:main Apr 12, 2022
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.

None yet

3 participants