Skip to content

Conversation

@josephmbeveridge
Copy link
Contributor

Summary

Resolves #99

Updated Typescript version to 3.7.3 and confirmed that optional chaining works in fresh project.

Test Plan

Create a new component which takes in an optional prop:

import React from 'react';
import {Text} from 'react-native';

interface Props {
  optionalFunction?: () => void;
}

const Test = ({optionalFunction}: Props) => {
  optionalFunction?.();
  return <Text>Testing optional chaining</Text>;
};

export default Test;

Include this new component in App.tsx and test passing a valid or undefined function. If the function is defined then it should execute before rendering. Something simple like () => console.log('Optional changing works!') is an easy check.

Compatibility

OS Implemented
iOS
Android

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I mentioned this change in CHANGELOG.md
  • I updated the typed files (TS and Flow)
  • I added a sample use of the API in the example project (example/App.js)

@radko93 radko93 merged commit b71dc7e into react-native-community:master Dec 13, 2019
@josephmbeveridge josephmbeveridge deleted the upgrade-typescript-3.7.3 branch December 16, 2019 17:13
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.

Typescript 3.7.x support

2 participants