0

while converting vue files in jetstream to react.js files i found # in template tag I think it's related to Laravel component but I don't know how to write it in react.js component.

in Vue

<template #trigger>
<template #content>

in livewire

<x-slot name="trigger">
<x-slot name="content">

what's equivalent of that in React.js?

aymen opa
  • 59
  • 5

2 Answers2

0

it would be:

<trigger />

or

 <trigger></trigger>

and

 <content />

or

<content></content>
Akbar khan
  • 54
  • 1
  • 4
0

after some research i found the solution vue HAS SLOTS it's called Named Slots Shorthand "#" it's just short for name= <template #trigger> is SAME as to understand more about slots watch net ninja video about slot Vue JS 2 Tutorial #27 - Slots and read vue document about slots https://v2.vuejs.org/v2/guide/components-slots.html#Named-Slots-Shorthand if you know react you can pass it through props easily

tony19
  • 125,647
  • 18
  • 229
  • 307
aymen opa
  • 59
  • 5