Handing over props

Hello everyone,

today we discussed about this type of handing over properties to a component. Are there any disadvantages (I’d expect some performance issues) when not assigning the desired properties one by one?

prototype(Test.Distribution:Component.Example) < prototype(Neos.Fusion:Component) {
propertyA = ''
propertyB = ''
propertyC = ''

renderer = Neos.Fusion:Component {
        @apply.props = ${props}
        [...]
}

You can make your life easier with @private which is now recommended over nested Components. Nesting Components always creates an additional layer of Fusion objects. That does not cost much but it adds up.

prototype(Test.Distribution:Component.Example) < prototype(Neos.Fusion:Component) {
   propertyA = ''
   propertyB = ''
   propertyC = ''
  
   @private {
     privateD = ${props.propertyA + ':::' + props.propertyB}
   }

   renderer = afx`
        [...]
  `
}
1 Like