olton / Metro4-React

Metro 4 for ReactJS. Build impressive responsive, mobile-first projects on the web with the first front-end component library in Metro Style and not only.
https://react.metroui.org.ua
MIT License
39 stars 9 forks source link

Failed to compile when requare any parts #30

Open fschenkun22 opened 3 years ago

fschenkun22 commented 3 years ago

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.

fschenkun22 commented 3 years ago

I used > npm install --save-dev @babel/preset-react , it is not work