0
votes

In react we can do

<SomeListComponent>
  <SomeListComponent.Item /> // Like this
</SomeListComponent>

is there a svelte equivalent of dot notation like in react?

1

1 Answers

1
votes

Nope.

Unwrap it:

<script>
  ...
  const { Item } = SomeListComponent
</script>

<SomeListComponent>
  <Item />
</SomeListComponent>

Note, also, that the component name must be capitalized (<Item />, not <item /> -- or Svelte would consider it's a DOM element).