Hi,
I'm trying to use unistore to rewrite react-accessible-accordion component.
I can't have it to work following the documentation.
I keep getting the following error on my "main" component (Accordion)
Error: n.getChildContext(): childContextTypes must be defined in order to use getChildContext()
(cf attached console screenshot)
My code is fairly basic:
// @flow
import React, { Component } from 'react';
import type { Node } from 'react';
import { createStore, Provider } from 'unistore/full/react';
type AccordionProps = {
accordion: boolean,
children: Node,
className: string,
onChange: Function,
activeItems: Array<string | number>,
};
class Accordion extends Component<AccordionProps, *> {
static defaultProps = {
accordion: true,
onChange: () => {},
className: 'accordion',
activeItems: [],
};
store = createStore({
accordion: this.props.accordion,
onChange: this.props.onChange,
activeItems: this.props.activeItems,
});
render() {
const { className, accordion, children } = this.props;
return (
<Provider store={this.store}>
<div>Test</div>
</Provider>
);
}
}
export default Accordion;

Hi,
I'm trying to use
unistoreto rewritereact-accessible-accordioncomponent.I can't have it to work following the documentation.
I keep getting the following error on my "main" component (Accordion)
Error: n.getChildContext(): childContextTypes must be defined in order to use getChildContext()(cf attached console screenshot)
My code is fairly basic: