Skip to content

Commit

Permalink
Removed using of <Fragment> for compatibility with legacy React (#81)
Browse files Browse the repository at this point in the history
* Removed using of <Fragment> for compatibility with legacy React
  • Loading branch information
Alexander Sakhaev authored and TroyAlford committed Mar 2, 2019
1 parent d76f9ac commit 4ea05c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/react-jsx-parser.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions source/components/JsxParser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Parser } from 'acorn-jsx'
import React, { Component, Fragment } from 'react'
import React, { Component } from 'react'
import parseStyle from '../helpers/parseStyle'
import { randomHash } from '../helpers/hash'
import resolvePath from '../helpers/resolvePath'
Expand Down Expand Up @@ -47,7 +47,7 @@ export default class JsxParser extends Component {
case 'JSXElement':
return this.parseElement(expression)
case 'JSXText':
return <Fragment key={randomHash()}>{expression.value || ''}</Fragment>
return (expression.value || '')
case 'JSXAttribute':
if (expression.value === null) return true
return this.parseExpression(expression.value)
Expand Down

0 comments on commit 4ea05c1

Please sign in to comment.