pull/10523/head
Rich Harris 3 years ago
parent 269884ac59
commit df93445096

@ -225,15 +225,12 @@ export function client_component(source, analysis, options) {
// Bind static exports to props so that people can access them with bind:x // Bind static exports to props so that people can access them with bind:x
const static_bindings = analysis.exports.map(({ name, alias }) => { const static_bindings = analysis.exports.map(({ name, alias }) => {
const binding = analysis.instance.scope.get(name);
return b.stmt( return b.stmt(
b.call( b.call(
'$.bind_prop', '$.bind_prop',
b.id('$$props'), b.id('$$props'),
b.literal(alias ?? name), b.literal(alias ?? name),
binding?.kind === 'state' || binding?.kind === 'frozen_state' serialize_get_binding(b.id(name), instance_state)
? b.call('$.get', b.id(name))
: b.id(name)
) )
); );
}); });

Loading…
Cancel
Save