Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

[OutlineView] better React HOC support #1628

Open
maggialejandro opened this issue Oct 8, 2018 · 0 comments
Open

[OutlineView] better React HOC support #1628

maggialejandro opened this issue Oct 8, 2018 · 0 comments

Comments

@maggialejandro
Copy link

Hi guys! It would be really nice if Outline view had better support for React Higher Order Components

For example:

/* @flow */
import React from 'react';
import { Modal } from 'react-native';

import styles from './styles';

type PropsType = {
  isVisible: boolean,
  onClose: () => void,
};

const ModalHOC = (): Function => (
  WrappedComponent: React.Element<*>,
): React.Element<*> =>
  class CustomModal extends React.PureComponent<PropsType> {
    handleClose = (): any => this.props.onClose();

    render(): React.Element<*> {
      return (
        <Modal
          style={styles.modal}
          hardwareAccelerated
          visible={this.props.isVisible}
          transparent
          onRequestClose={this.handleClose}
          supportedOrientations={['portrait', 'landscape']}
        >
          <WrappedComponent {...this.props} />
        </Modal>
      );
    }
  };

export default ModalHOC;

Expected Behavior (VS Code)

captura de pantalla 2018-10-08 a la s 14 55 25

Actual Behavior

captura de pantalla 2018-10-08 a la s 14 55 46

Versions

  • Atom: 1.31.2
  • Nuclide: 0.354.0
  • Client OS: macOS
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant