Next code from Getting started guide will crush
import preact from 'preact';
console.log(preact) // undefined
preact.render((
<div id="foo">
<span>Hello, world!</span>
</div>
), document.body);
I see in console next warn and error
Cannot read property 'render' of undefined
"export 'default' (imported as 'preact') was not found in 'preact'
For fix i use next workaround:
import * as { preact } from 'preact';
If that expected behavior - please fix this example in manual.
My env:
preact: "10.0.0-alpha.2"
webpack: "4.29.6"
@babel/core: "7.3.4"
node: "v11.10.1"
yarn: "1.13.0"
That's right, I don't think there is a default export in the regular preact package at this point. However there is one in the Preact/Compat one.
yup, that's correct. We don't have a default export in core anymore. See the "Breaking Changes" section in the release notes for more information.
Most helpful comment
yup, that's correct. We don't have a
defaultexport in core anymore. See the "Breaking Changes" section in the release notes for more information.