5.9.3. Admin Development Constraints
This chapter lists some constraints of admin widgets and UI routes.
Arrow Functions#
Widget and UI route components must be created as arrow functions.
1 2 function ProductWidget ( ) { 3 4 } 5
6 7 const ProductWidget = ( ) => { 8 9 }
A widget zone's value must be wrapped in double or single quotes. It can't be a template literal or a variable.
1 2 export const config = defineWidgetConfig ( { 3 zone : ` product.details.before ` , 4 } ) 5
6 7 const ZONE = "product.details.after" 8 export const config = defineWidgetConfig ( { 9 zone : ZONE , 10 } ) 11
12 13 export const config = defineWidgetConfig ( { 14 zone : "product.details.before" , 15 } )
Was this chapter helpful? It was helpful It wasn't helpful Report Issue
Edit this page