Uncaught Error: react-polymer must be required before react
Closed this issue · 5 comments
I am gettting this error even though my imports seen to correct order
import reactPolymer from 'react-polymer'; import React , {Component} from 'react'; import {FlowRouter} from 'meteor/kadira:flow-router'; import { PaperCheckbox, PaperToggleButton, PaperInput, PaperTextarea, IronAutogrowTextarea, PaperSlider, PaperMenu, PaperListbox, PaperRadioGroup, PaperTabs, IronSelector } from 'react-polymer/input'
I have build repo too
https://github.com/gurjit03/react-charts-test-app
I am using react-polymer in for test imports/Pages/Home.jsx
You have to import react-polymer before you import react in any file, not just the one where you use react-polymer. If you put import 'react-polymer'
at the top of main.js, it should work.
The reason is that react-polymer has to monkey-patch parts of react to make it work, and this is impossible once react has been loaded for the first time.
@jscissr , i have put the import 'react-polymer
at the top of main.js, still its complaining.
I'm not familiar with meteor, maybe you need to put it in routes.jsx. If that also doesn't work, you'll have have find out yourself where react is imported for the first time.