`dotcom-ui-layout` v0.3.1 -> v0.3.2 upgrade doesn't render drawer
Closed this issue · 8 comments
Upgrading from 0.3.1 -> 0.3.2 resulted in the drawer not rendering for Globetrotter.
We had not changed our implementation when upgrading.
rollback PR in globetrotter: https://github.com/Financial-Times/globetrotter/pull/167
I have spoken to Nick and the drawer menu was not present in the html for the simple
header.
v0.3.2 is in prod for all other apps using Page Kit which appear to be OK.
Could you link us to the integration of the Page Kit layout or header components @nickramsbottom so we can take a look?
Sure! This is where we use it: https://github.com/Financial-Times/globetrotter/blob/master/packages/ssg/tools/make-edition-layouts.js
Thanks - I don't see anything strange there, although I did spot this comment... is this statement still correct?
If it is then there is definitely something funky going on!
OH, I know why...
The defaultProps
will only be applied when using the createElement
factory function... so calling the Shell()
and Layout()
functions directly will result in no default props.
So, either...
// Use the factory function
React.createElement(Layout, props)
// Or munge the default props yourself
Layout({ ...Layout.defaultProps, foo: 1, bar: 2 })
Cheers @i-like-robots!! I'll have a go with this today
All working, thank you!