z0h4n / react-seven-segment-display

A Seven Segment Display Component for ReactJS
1 stars 3 forks source link

Fails with Create React App #1

Closed macdja38 closed 5 years ago

macdja38 commented 5 years ago
Compiling...
Failed to compile.

./node_modules/react-seven-segment-display/SevenSegmentDisplay.js
SyntaxError: PROJECT_PATH\node_modules\react-seven-segment-display\SevenSegmentDisplay.js: Unexpected token (45:6)

  43 | 
  44 |     return (
> 45 |       <div style={container}>
     |       ^
  46 |         <HSegment width={width} height={height} color={this.onOff('a')} />
  47 |         <div style={vSegmentHolder}>
  48 |           <VSegment width={height} height={width} color={this.onOff('f')} align="left" />

Probably caused by create-react-app not compiling dependencies, potentially the JSX could be transformed into React.createElement calls before publishing on npm? Alternatively to aid in the usage of this library it would be helpful to have instructions for how to use it with create react app or other tools that don't compile dependencies.

macdja38 commented 5 years ago

For more info on if this is wrong please see https://github.com/facebook/create-react-app/issues/5103#issuecomment-425459196

z0h4n commented 5 years ago

@macdja38 Apologies for getting to this so late, and thank you creating this issue. I published a transpiled version on npm. Also tested this with create-react-app. Should be good now.

macdja38 commented 5 years ago

@z0h4n no problem, thanks for fixing this! Love this library otherwise!