react-virtualized icon indicating copy to clipboard operation
react-virtualized copied to clipboard

I need help with contextTypes.

Open Zulfia73 opened this issue 9 years ago • 2 comments

I want add dynamic height for items of List. And I add in contextTypes : list: PropTypes.instanceOf(Immutable.List).isRequired As in example. But this.context.list: undefined all time. I can't understant what do. Thanks!

Zulfia73 avatar Nov 14 '17 07:11 Zulfia73

https://github.com/bvaughn/react-virtualized/blob/master/source/demo/Application.js#L48-L53 https://github.com/bvaughn/react-virtualized/blob/master/source/demo/Application.js#L68-L76

TrySound avatar Nov 14 '17 07:11 TrySound

Hi @Zulfia73,

For contextTypes to work in your component, it will need a parent component that declares a matching childContextTypes.

You can read all about context in the official React docs here: https://reactjs.org/docs/context.html#how-to-use-context

bvaughn avatar Nov 25 '17 16:11 bvaughn