Skip to content

Ignore JSX Expression blocks #7

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

Merged
merged 1 commit into from
Apr 21, 2017

Conversation

dagjaneiro
Copy link
Contributor

@dagjaneiro dagjaneiro commented Apr 20, 2017

We should ignore JSX elements rendered inside expression blocks
since they do not represent individual components.

Previously the following example would add the displayName property to the content element:

import React from 'react'

const HelloWorld = () => {
  const content = (
    <div>
      {
        [1, 2, 3].map((n) => { return <h1>{n}</h1> })
      }
    </div>
  )

  return <div>{content}</div>
}

export default HelloWorld

This would throw a runtime error since content is a react element and cannot be extended with other properties.

We should ignore JSX elements rendered inside expression blocks
since they do not represent individual components.
@codecov
Copy link

codecov bot commented Apr 20, 2017

Codecov Report

Merging #7 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #7   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          28     30    +2     
=====================================
+ Hits           28     30    +2
Impacted Files Coverage Δ
src/index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12dbbf9...eccc50c. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Apr 20, 2017

Codecov Report

Merging #7 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #7   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          28     30    +2     
=====================================
+ Hits           28     30    +2
Impacted Files Coverage Δ
src/index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12dbbf9...eccc50c. Read the comment docs.

@wyze
Copy link
Owner

wyze commented Apr 21, 2017

Thanks, this looks really good!

@wyze wyze merged commit e98586f into wyze:master Apr 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants