Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose ReactCompositeComponentInterface #2668

Closed
tgriesser opened this issue Dec 6, 2014 · 1 comment
Closed

Expose ReactCompositeComponentInterface #2668

tgriesser opened this issue Dec 6, 2014 · 1 comment

Comments

@tgriesser
Copy link

I realize that once you start patching the internals of a project it's pretty much at your own risk, but in this case I was looking to add a stateTypes plugin which would act similar to propTypes / contextTypes, where you could have validations built-in for state as they change over time. Our application is using a fully immutable data store and uses a ton of state to be able to isolate individual units of the root data to prevent unnecessary re-renders when we know exactly where the path has changed.

I was able to get this working pretty quickly, but I'm unable to SpecPolicy.DEFINE_MANY because the ReactCompositeComponentInterface is internal.

I could see why exposing this fully might be a bad idea, but I wanted to see if there has been any discussion of allowing consumers to hook into the SpecPolicy behavior and define their own merge-able types outside of the core.

@tgriesser
Copy link
Author

Alternatively, if the stateTypes feature I mentioned is something that others feel would be worth adding, I'd be willing to put together a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants