Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

fromRenderProps RenderPropsComponent props #740

Open
sshmyg opened this issue Sep 18, 2018 · 3 comments
Open

fromRenderProps RenderPropsComponent props #740

sshmyg opened this issue Sep 18, 2018 · 3 comments

Comments

@sshmyg
Copy link

sshmyg commented Sep 18, 2018

Hi. As I know when I use renderComponent renderer component gets props from previous HOCs.
But here fromRenderProps, component doesn't get nothing.

Is there any reason why component from fromRenderProps not get props from previous HOCs?

export default compose(
    defaultProps({
        query: {
            a: 10
        }
    }),

    fromRenderProps(Query, ({ writeData }) => ({
        writeData
    })),
);

Expect: Query component gets query as prop during initialization here fromRenderProps.
Actual: Query initializes without props;

@istarkov
Copy link
Contributor

cc @evenchange4

@brabeji
Copy link

brabeji commented Sep 24, 2018

@istarkov Having this fixed locally for some time, I've finally found some time to push it.

@elquimista
Copy link

elquimista commented Nov 28, 2018

@sshmyg AFAIK, the first argument of fromRenderProps is something like Consumer of React context, e.g., ThemeContext.Consumer. It is not the target component that gets wrapped inside the final HOC, therefore this is an expected behavior and not a bug.

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

No branches or pull requests

4 participants