Metro4-React
Metro4-React copied to clipboard
Failed to compile when requare any parts
I use command > npm install metro4-react and then: import {Button} from "metro4-react";
import React, { Component } from 'react'
import {Button} from "metro4-react";
export default class App extends Component {
render() {
return (
<div>
<Button>Button</Button>
</div>
)
}
}
How can I solve the following problem
Failed to compile ./node_modules/metro4-react/src/components/tag-input/tag-input.js SyntaxError: E:\WWW\gitSearch\git-search\node_modules\metro4-react\src\components\tag-input\tag-input.js: Support for the experimental syntax 'jsx' isn't currently enabled (142:13):
140 | 141 | return (
142 | <div className={
tag-input ${focus ? 'focused' : ''} ${staticMode ? 'static-mode' : ''}
} ref={this.component}> | ^ 143 | {tags.map( (tag, index) => { 144 | return ( 145 | <Tag
Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation. If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing. This error occurred during the build time and cannot be dismissed.Failed to compile ./node_modules/metro4-react/src/components/tag-input/tag-input.js SyntaxError: E:\WWW\gitSearch\git-search\node_modules\metro4-react\src\components\tag-input\tag-input.js: Support for the experimental syntax 'jsx' isn't currently enabled (142:13):
140 | 141 | return (
142 | <div className={
tag-input ${focus ? 'focused' : ''} ${staticMode ? 'static-mode' : ''}
} ref={this.component}> | ^ 143 | {tags.map( (tag, index) => { 144 | return ( 145 | <Tag
Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation. If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing. This error occurred during the build time and cannot be dismissed.
I used > npm install --save-dev @babel/preset-react , it is not work