{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/1896","labels_url":"https://api.github.com/repos/facebook/react/issues/1896/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/1896/comments","events_url":"https://api.github.com/repos/facebook/react/issues/1896/events","html_url":"https://github.com/facebook/react/issues/1896","id":38260294,"number":1896,"title":"Expose mixin method on created Classes","user":{"login":"jquense","id":339286,"avatar_url":"https://avatars.githubusercontent.com/u/339286?v=3","gravatar_id":"","url":"https://api.github.com/users/jquense","html_url":"https://github.com/jquense","followers_url":"https://api.github.com/users/jquense/followers","following_url":"https://api.github.com/users/jquense/following{/other_user}","gists_url":"https://api.github.com/users/jquense/gists{/gist_id}","starred_url":"https://api.github.com/users/jquense/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jquense/subscriptions","organizations_url":"https://api.github.com/users/jquense/orgs","repos_url":"https://api.github.com/users/jquense/repos","events_url":"https://api.github.com/users/jquense/events{/privacy}","received_events_url":"https://api.github.com/users/jquense/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2014-07-20T15:47:55Z","updated_at":"2015-05-25T18:11:28Z","closed_at":"2015-04-01T22:39:03Z","body":"It would be helpful if the `mixSpecIntoComponent` and its static variant were accessible on the returned descriptor from `createClass()`. That way components need not be defined all at once, giving someone the ability to mixin into someone else's component if they wish. \r\n\r\nIn my limited experience this stuff is also really helpful for using React in a larger app framework context. For instance, dependency injection in an ember-esque  way would be really easy, allowing me to inject props/methods, on a type/classes basis in stead of the current (albeit undocumented) global injection functionality in react now.\r\n\r\nIt also just seems like an unnecessary restriction, not in keeping with the dynamic nature of the language. Why not embrace the prototypal nature of js, and bless redefining/reopening 'Classes'?\r\n\r\nmy own rudimentary experiments with this has gone well enough, and it fits nicely with the composition-focused abstractions in React. Admittedly, not knowing what the ultimate plan for the `ReactDescriptor` makes it hard to guess at possible conflicts with this approach. One escape hatch might be the additional ability to seal classes?\r\n\r\nIs their a strong reason fro not exposing these methods on the descriptor?"},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/105283834","html_url":"https://github.com/facebook/react/issues/1896#issuecomment-105283834","issue_url":"https://api.github.com/repos/facebook/react/issues/1896","id":105283834,"user":{"login":"brigand","id":936069,"avatar_url":"https://avatars.githubusercontent.com/u/936069?v=3","gravatar_id":"","url":"https://api.github.com/users/brigand","html_url":"https://github.com/brigand","followers_url":"https://api.github.com/users/brigand/followers","following_url":"https://api.github.com/users/brigand/following{/other_user}","gists_url":"https://api.github.com/users/brigand/gists{/gist_id}","starred_url":"https://api.github.com/users/brigand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brigand/subscriptions","organizations_url":"https://api.github.com/users/brigand/orgs","repos_url":"https://api.github.com/users/brigand/repos","events_url":"https://api.github.com/users/brigand/events{/privacy}","received_events_url":"https://api.github.com/users/brigand/received_events","type":"User","site_admin":false},"created_at":"2015-05-25T18:11:28Z","updated_at":"2015-05-25T18:11:28Z","body":"@dendril, an [example of reimplementing mixins outside of react](https://github.com/brigand/react-mixin).\r\n\r\nBasically if you have a constructor with a prototype, you can do pretty much anything you want to it. Whether that's wrapping it in another component, extending from it, mixins, traits, or anything else.\r\n\r\nThere was another issue that hinted towards wrapping (\"high order components\") is the way to go, and in my experience, it works very well.\r\n"}}