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

fix(Assertions): use React #2

Merged
merged 6 commits into from
Jan 3, 2017
Merged

fix(Assertions): use React #2

merged 6 commits into from
Jan 3, 2017

Conversation

layershifter
Copy link
Owner

@layershifter layershifter commented Dec 20, 2016

Preamble

In initial test-run I've expirienced problems with normal functions. Plugins wants to transform non-react code:

if (!handledProps) {
  handledProps = []

  if (autoControlledProps) pushUnique(autoControlledProps, handledProps)
  if (defaultProps) pushUnique(Object.keys(defaultProps), handledProps)
  if (propTypes) pushUnique(Object.keys(propTypes), handledProps)

  Component.handledProps = handledProps
}

Solution

Add assertions that will check that we really transforming React component.

TODO:

  • fix usage of buildCodeFrameError in assertions;
  • add assertions for React stateless and statefull components;
  • reduce visits.

@layershifter layershifter merged commit 5855e8b into master Jan 3, 2017
@layershifter layershifter deleted the fix/use-react branch January 3, 2017 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant