Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContextExample touch ups #1

Merged
merged 2 commits into from
Nov 28, 2016
Merged

ContextExample touch ups #1

merged 2 commits into from
Nov 28, 2016

Conversation

wcjordan
Copy link

Description

I've made some cleanups to your Context example. Please let me know your thoughts.

Motivation and Context

Working on making the context example easier to follow.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.


const AdvancedTable = AddFilter(DataCtxt(Table));
const FilterablePagingTable = AddFilter(DataCtxt(Table));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed everything which was Advanced to be more descriptive

* @param {string} propName The prop that is to be validated
* @param {string} componentName The name of the component that the prop belongs to
*/
function PropTypeCtxtData(props, propName, componentName) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since propTypes aren't a FDT specific thing and they clutter these examples, I've moved them to a helper file

@@ -1,42 +0,0 @@
import React from 'react';
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code

@@ -9,6 +9,13 @@ var Constants = require('../Constants');

var ExampleHeader = React.createClass({
render() {
const contextDisclamer = this.props.page.fileName === 'ContextExample.js' ? (
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is less than ideal, but I didn't see a good way to add this without a larger refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants