Skip to content

Instantly share code, notes, and snippets.

@codigoconjuan
Last active August 26, 2023 10:31
Show Gist options
  • Save codigoconjuan/d8811fc30aeb73e3df8529b334924817 to your computer and use it in GitHub Desktop.
Save codigoconjuan/d8811fc30aeb73e3df8529b334924817 to your computer and use it in GitHub Desktop.
Materiales REDUX
{
"productos": [
{
"id": 1,
"nombre": "Jugo de Zanahoria",
"precio": "31111"
},
{
"id": 2,
"nombre": "Jugo de Naranja",
"precio": "1"
},
{
"nombre": "Jugo de Naranja",
"precio": "300",
"id": 3
},
{
"nombre": "Rib Eye 800g",
"precio": "200",
"id": 4
},
{
"nombre": "Jugo de Fresa",
"precio": "200",
"id": 5
}
]
}
body {
margin: 0;
padding: 0;
font-weight: 400;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: 16px;
}
h1 a {
font-size: 1.8rem;
}
h1 a.text-light:hover {
color: white!important;
text-decoration: none!important;
}
.nuevo-post{
font-weight: bold;
text-transform: uppercase;
}
.btn {
font-weight: bold;
}
.form-group label,
.list-group-item {
font-size: 1.4rem;
}
.navbar .btn {
flex:1;
}
@media (min-width:768px){
.navbar .btn {
flex: 0 1 auto;
}
}
.acciones {
margin: 1rem 0;
}
@media (min-width:768px) {
.acciones{
margin: 0;
}
}
.acciones > *{
flex: 1;
}
<title>React, Redux, React Router DOM</title>
<link rel="stylesheet" href="https://bootswatch.com/4/minty/bootstrap.min.css">
@RADPi
Copy link

RADPi commented Jan 26, 2022

Hola:
El tbody del componente Productos lo tuve que armar así, para quitar un error "Text nodes cannot appear as a child of <tbody>."

<tbody>
	{productos.length === 0 ? (
		<tr>
			<td colSpan='3'>No hay productos</td>
		</tr>
	) : (
		productos.map(producto => (
			<Producto key={producto.id} producto={producto} />
		))
	)}
</tbody>

@Guido-87
Copy link

Guido-87 commented Jun 5, 2022

Hola: El tbody del componente Productos lo tuve que armar así, para quitar un error "Text nodes cannot appear as a child of <tbody>."

<tbody>
	{productos.length === 0 ? (
		<tr>
			<td colSpan='3'>No hay productos</td>
		</tr>
	) : (
		productos.map(producto => (
			<Producto key={producto.id} producto={producto} />
		))
	)}
</tbody>

Gracias Radpi por la respuesta, igualmente no es un error es un warning.

@breadsk
Copy link

breadsk commented Mar 14, 2023

Gracias Profesor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment