Skip to content

Commit

Permalink
Readd React import in formatElements to support jsx (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca authored Apr 7, 2022
1 parent b01e2f9 commit 5a3c1a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-translate",
"version": "1.3.6-canary.3",
"version": "1.3.6-canary.4",
"description": "Tiny and powerful i18n tools (Next plugin + API) to translate your Next.js pages.",
"license": "MIT",
"keywords": [
Expand Down
8 changes: 1 addition & 7 deletions src/formatElements.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
cloneElement,
Fragment,
ReactElement,
ReactNode,
} from 'react'
import React, { cloneElement, Fragment, ReactElement, ReactNode } from 'react'

const tagRe = /<(\w+)>(.*?)<\/\1>|<(\w+)\/>/
const nlRe = /(?:\r\n|\r|\n)/g
Expand All @@ -20,7 +15,6 @@ function getElements(
].concat(getElements(parts.slice(4, parts.length)))
}


export default function formatElements(
value: string,
elements: ReactElement[] | Record<string, ReactElement> = []
Expand Down

0 comments on commit 5a3c1a1

Please sign in to comment.