Skip to content

[Docs] Improve propTypes parsing for NavigatorIOS docs #1230

@brentvatne

Description

@brentvatne

We are losing a lot of helpful documentation here with the way it is currently being displayed:

screen shot 2015-05-10 at 3 00 02 pm

In the source:

    /**
     * NavigatorIOS uses "route" objects to identify child views, their props,
     * and navigation bar configuration. "push" and all the other navigation
     * operations expect routes to be like this:
     */
    initialRoute: PropTypes.shape({
      /**
       * The React Class to render for this route
       */
      component: PropTypes.func.isRequired,

      /**
       * The title displayed in the nav bar and back button for this route
       */
      title: PropTypes.string.isRequired,

      /**
       * Specify additional props passed to the component. NavigatorIOS will
       * automatically provide "route" and "navigator" components
       */
      passProps: PropTypes.object,

      /**
       * If set, the left header button image will appear with this source. Note
       * that this doesn't apply for the header of the current view, but the
       * ones of the views that are pushed afterward.
       */
      backButtonIcon: Image.propTypes.source,

      /**
       * If set, the left header button will appear with this name. Note that
       * this doesn't apply for the header of the current view, but the ones
       * of the views that are pushed afterward.
       */
      backButtonTitle: PropTypes.string,

      /**
       * If set, the left header button image will appear with this source
       */
      leftButtonIcon: Image.propTypes.source,

      /**
       * If set, the left header button will appear with this name
       */
      leftButtonTitle: PropTypes.string,

      /**
       * Called when the left header button is pressed
       */
      onLeftButtonPress: PropTypes.func,

      /**
       * If set, the right header button image will appear with this source
       */
      rightButtonIcon: Image.propTypes.source,

      /**
       * If set, the right header button will appear with this name
       */
      rightButtonTitle: PropTypes.string,

      /**
       * Called when the right header button is pressed
       */
      onRightButtonPress: PropTypes.func,

      /**
       * Styles for the navigation item containing the component
       */
      wrapperStyle: View.propTypes.style,

    }).isRequired

Metadata

Metadata

Assignees

Labels

Good first issueInterested in collaborating? Take a stab at fixing one of these issues.Resolution: LockedThis issue was locked by the bot.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions