--- id: 5a24c314108439a4d403616c title: Override Default Props challengeType: 6 isRequired: false videoUrl: '' localeTitle: Anular apoyos predeterminados --- ## Description
La capacidad de establecer accesorios predeterminados es una característica útil en React. La forma de anular los accesorios predeterminados es establecer explícitamente los valores de prop para un componente.
## Instructions
El componente ShoppingCart ahora representa un componente secundario Items . Este componente de Items tiene una quantity prop predeterminada establecida en el entero 0 . Anule el prop predeterminado al pasar un valor de 10 por quantity . Nota: recuerde que la sintaxis para agregar una propuesta a un componente es similar a la forma en que agrega atributos HTML. Sin embargo, dado que el valor para la quantity es un número entero, no irá entre comillas, pero debería estar entre corchetes. Por ejemplo, {100} . Esta sintaxis le dice a JSX que interprete el valor entre las llaves directamente como JavaScript.
## Tests
```yml tests: - text: El componente ShoppingCart debe renderizar. testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ShoppingCart)); return mockedComponent.find("ShoppingCart").length === 1; })(), "The component ShoppingCart should render.");' - text: Los Items componente deben hacer. testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ShoppingCart)); return mockedComponent.find("Items").length === 1; })(), "The component Items should render.");' - text: 'El componente Items debe tener una propiedad de { quantity: 10 } aprobada desde el componente ShoppingCart .' testString: 'getUserInput => assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ShoppingCart)); return mockedComponent.find("Items").props().quantity == 10 && getUserInput("index").replace(/ /g,"").includes(""); })(), "The Items component should have a prop of { quantity: 10 } passed from the ShoppingCart component.");' ```
## Challenge Seed
```jsx const Items = (props) => { return

Current Quantity of Items in Cart: {props.quantity}

} Items.defaultProps = { quantity: 0 } class ShoppingCart extends React.Component { constructor(props) { super(props); } render() { { /* change code below this line */ } return { /* change code above this line */ } } }; ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```