facebook / facebook/flow

[question] Extend module types

Open
#4,667 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

It's a question that should be asked on SO, but I can't get a response there..

In a React Native app I am assigning a custom method to the `console` e.g. `console.foo = (string) => {}`. The console module type is already [defined here](https://github.com/facebook/react-native/blob/master/flow/console.js). So I get the error: `Property not found in object type`. How can I extend a console module with a custom method type?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.