iam4x / react-btn-checkbox

React component for displaying checkboxes and radios as button
http://iam4x.github.io/react-btn-checkbox/
25 stars 8 forks source link

Uncaught TypeError: Can't add property context, object is not extensible #1

Closed shantp closed 9 years ago

shantp commented 9 years ago

I tried using this with 0.13rc2 of react and I'm getting this error. Here's my code:

import React from 'react';
import {Radio} from 'react-btn-checkbox';

class RadioApp extends React.Component {
  constructor(props){
    super(props);
    this.state = {
      'First': false,
      'Second': true,
      'Third': false
    }
  }
  render(){
    return (
      <Radio options={this.state} onChange={this.setState.bind(this)} />
    )
  }
}

React.render(<RadioApp />, document.getElementById("app"));

Also getting these warnings:

Warning: Something is calling a React component directly. Use a factory or JSX instead. See: http://fb.me/react-legacyfactory app.js:20318 Warning: Don't set the props property of the component. Mutate the existing props object instead.

Maybe this has to do with mixins in ES6?

iam4x commented 9 years ago

Hello @shantp

Can you check with sourcemaps or unminified code? Because app.js:20318 it's hard to know where does it comes :)

Seems more a problem with mutating props with your super(props) call, but I'm may be wrong... since I haven't tried 0.13 yet, gonna check this afternoon :)

Spendar89 commented 9 years ago

It doesn't look like this was addressed... running into the same issue.

juddey commented 9 years ago

I'm getting the same as shantp too, same react version.

stanislav-ostapenko commented 9 years ago

have the same issue

iam4x commented 9 years ago

Guys sorry for late update, can you test last release?

juddey commented 9 years ago

sure :)

juddey commented 9 years ago

Nice - its rendering without those errors now, thanks for fixing that up :+1:

stanislav-ostapenko commented 9 years ago

Yep, works fine.

iam4x commented 9 years ago

Great, I'll close this :)