Skip to content

Commit

Permalink
docs(README): isConnected is nullable, add optional chaining (#588)
Browse files Browse the repository at this point in the history
Adding optional chaining as isConnected may be null causing an error:
>Uncaught TypeError: Cannot read properties of null (reading 'toString')
  • Loading branch information
JDMathew committed Apr 21, 2022
1 parent f05f7dd commit 7f040ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ const YourComponent = () => {
return (
<View>
<Text>Type: {netInfo.type}</Text>
<Text>Is Connected? {netInfo.isConnected.toString()}</Text>
<Text>Is Connected? {netInfo.isConnected?.toString()}</Text>
</View>
);
};
Expand Down

0 comments on commit 7f040ce

Please sign in to comment.