OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Cannot find name 'animals'.ts(2304)

  • Thread starter Thread starter Nicolas Bock
  • Start date Start date
N

Nicolas Bock

Guest
Im doing a web using astro, tailwind css and nodejs

Code:
---
import { useEffect, useState } from 'react';

interface Animal {
  address: string;
  streets: string;
  details: string;
  imageUrl: { data: Uint8Array };
}
---
<div>
  <h1>Datos de Animales</h1>
  <div id="data">
    {animals.length === 0 ? (
      <p>No hay datos disponibles.</p>
    ) : (
      animals.map((animal, index) => (
        <div key={index}>
          <p>Dirección: {animal.address}</p>
          <p>Entre Calles: {animal.streets}</p>
          <p>Detalles: {animal.details}</p>
          <p>
            Imagen:
            <img
              src={`data:image/jpeg;base64,${btoa(
                String.fromCharCode(...new Uint8Array(animal.imageUrl.data))
              )}`}
              alt="Animal"
            />
          </p>
        </div>
      ))
    )}
  </div>
</div>

Cannot find name 'animals'.ts(2304) i dont know why i have this issue, and i have another one: Type '{ children: any[]; key: any; }' is not assignable to type 'HTMLAttributes'. Property 'key' does not exist on type 'HTMLAttributes'.ts(2322) if someone can help me tell me pls
<p>Im doing a web using astro, tailwind css and nodejs</p>
<pre><code>---
import { useEffect, useState } from 'react';

interface Animal {
address: string;
streets: string;
details: string;
imageUrl: { data: Uint8Array };
}
---
<div>
<h1>Datos de Animales</h1>
<div id="data">
{animals.length === 0 ? (
<p>No hay datos disponibles.</p>
) : (
animals.map((animal, index) => (
<div key={index}>
<p>Dirección: {animal.address}</p>
<p>Entre Calles: {animal.streets}</p>
<p>Detalles: {animal.details}</p>
<p>
Imagen:
<img
src={`data:image/jpeg;base64,${btoa(
String.fromCharCode(...new Uint8Array(animal.imageUrl.data))
)}`}
alt="Animal"
/>
</p>
</div>
))
)}
</div>
</div>

</code></pre>
<p>Cannot find name 'animals'.ts(2304)
i dont know why i have this issue, and i have another one:
Type '{ children: any[]; key: any; }' is not assignable to type 'HTMLAttributes'.
Property 'key' does not exist on type 'HTMLAttributes'.ts(2322)
if someone can help me tell me pls</p>
Continue reading...
 

Latest posts

I
Replies
0
Views
1
impact christian
I
Top