Open JoseInTheArena opened 7 years ago
Just been trying to get bluekit to work with some (lightly) connected components. Ended up resorting to wrapping each component like this:
import React, { Component } from 'react';
import BlueKit from 'react-bluekit';
import componentsIndex from 'src/componentsIndex';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
const store = createStore(s => s, {
// minimal initial store state
});
const wrappedComponentsIndex = Object.keys(componentsIndex).reduce((nci, key) => {
const componentEntry = componentsIndex[key];
const ActualComponent = componentEntry.component;
return {
...nci,
[key]: {
...componentEntry,
component: props => (
<Provider store={store}>
<ActualComponent {...props} />
</Provider>
),
},
};
}, {});
export default class PageWithBlueKit extends Component {
render() {
return (
<BlueKit
componentsIndex={wrappedComponentsIndex}
/>
);
}
}
Hi,
I have a React/Redux app for which I use bluekit. When I use redux's
connect()
function I get the error below (you'll also find my component's code after the error).I did some digging and it seems
react-docgen
doesn't like the fact that I have my component and the component that's produced by calling connect. I installed react-docgen and it seems that if I use thefindAllComponentDefinitions
resolver, everything works. Is this something that can be added to bluekit, maybe as a flag?This is my component's code: