reapp / reapp-ui

Amazing cross platform UI's with React and JavaScript
https://reapp.io
MIT License
257 stars 47 forks source link

Theme child context not passed down when used standalone via webpack #83

Closed hellogerard closed 9 years ago

hellogerard commented 9 years ago

Hello,

Trying to use reapp-ui standalone in a Meteor app. I got it importing fine, but themes would not work. After digging, it looked like the theme info in the React child contexts were not getting passed down (using the Theme helper). I'm using webpack to build.

My simple component:

import React, { Component } from 'react';
import iOSTheme from 'reapp-ui/themes/ios/theme'
import Theme from 'reapp-ui/helpers/Theme';
import Button from 'reapp-ui/components/Button';

export default class App extends Component {
  render() {
    return (
      <Theme {...iOSTheme}>
        <Button color="red">Hello</Button>
      </Theme>
    );
  }
}

When I load it in the browser, everything loads without errors, but I get the label Hello and nothing else (see screenshot). If I inspect with the React Chrome inspector, I see the Theme helper component with the theme info in its props. But the Button component has no context. (BTW, the color="red" prop doesn't work either.)

screen_shot_2015-11-13_at_6_28_31_pm

Of course, everything works fine when using the reapp command line.

I'm using react@0.13.2 and reapp-ui@0.12.54.

What am I missing?

natew commented 9 years ago

I'm actually getting this as well, and don't have a ton of time to debug. Tried a few things but no dice so far.

hellogerard commented 9 years ago

So I just tried it again, and it works for me now. Something fixed it between 0.12.54 and 0.12.70. Feel free to close this.

screen shot 2015-11-21 at 3 49 30 pm