File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -320,6 +320,28 @@ class ComponentB extends owl.Component {
320320
321321Note: the props validation code is done by using the [ validate utility function] ( utils.md#validate ) .
322322
323+ ### ` slots ` prop
324+
325+ If a component that uses [ slots] ( slots.md ) also lists or validates its props, then
326+ you will have to explicitely allow the ` slots ` prop (with an ` Object ` type), or
327+ allow extra props using the ` * ` notation mentioned above. This is because slots
328+ are provided to a component [ as props] ( slots.md#slots-and-props ) .
329+
330+ For example:
331+
332+ ``` js
333+ class MyComponent extends Component {
334+ static props = [someProp, slots? ];
335+ }
336+
337+ class MyComponentWithValidation extends Component {
338+ static props = {
339+ someProp: {type: Number , optional: true },
340+ slots : {type: Object , optional: true },
341+ }
342+ }
343+ ` ` `
344+
323345## Good Practices
324346
325347A ` props` object is a collection of values that come from the parent. As such,
You can’t perform that action at this time.
0 commit comments