gfazioli / react-switch-button

React Switch Button control
http://gfazioli.github.io/react-switch-button/
MIT License
86 stars 36 forks source link

Enable to make it work (dependencies problem?) #36

Closed redouane59 closed 6 years ago

redouane59 commented 6 years ago

Hello,

After having done the npm install react-switch-button --save, i have those warnings :

Compiled successfully! npm WARN react-addons-pure-render-mixin@0.14.8 requires a peer of react@^0.14.8 but none is installed. You must install peer dependencies yourself. npm WARN react-d3-radar@0.2.6 requires a peer of react@^15.0.0 but none is installed. You must install peer dependencies yourself. npm WARN react-datepicker@0.27.0 requires a peer of react@^0.14.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself. npm WARN react-datepicker@0.27.0 requires a peer of react-dom@^0.14.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\react-scripts\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

  • react-switch-button@2.3.3 added 230 packages and updated 1 package in 49.968s

In my App.js class, after having import the module using import SwitchButton from 'react-switch-button'; I just try to include it in my render function this way <SwitchButton label="Click me" /> and i always have the same error :

InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('/static/media/react-switch-button.857546cd.jsx') is not a valid name.

Could you help me ?

sugandhgoyal commented 6 years ago

I am having the same error

giwiro commented 6 years ago

Me too.

simeng-yang commented 6 years ago

I'm having the same issue.

gfazioli commented 6 years ago

Hey, I've created a new fresh component here https://github.com/gfazioli/react-toggle

It's the same component but now working fine. Use yarn add react-toggle-component

and import Toggle from "react-toggle-component"

With this new version, you don't need to load the styles. They are embedded.

Let me know if everything is ok