Skip to content
This repository has been archived by the owner on Feb 15, 2019. It is now read-only.

Fix flow for children prop #301

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
4 changes: 3 additions & 1 deletion src/shared-element/ExNavigationSharedElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import {
UIManager,
findNodeHandle,
} from 'react-native';
import invariant from 'invariant';

import type { TransitionProps, Metrics } from './ExNavigationSharedElementReducer';

type Props = {
children: () => React.Element<*>,
children?: () => React.Element<*>,
id: string,

// This is not part of the public API and is used by the overlay to pass down
Expand Down Expand Up @@ -43,6 +44,7 @@ export default class SharedElement extends Component {
);
}

invariant(childFn, 'Must pass a function as a child to `SharedElement`.');
const childEl = childFn(animationStyle);

return cloneElement(childEl, {
Expand Down