solid-docs icon indicating copy to clipboard operation
solid-docs copied to clipboard

TS forEach error in colored-list.tsx @ tutorial/props_children?solved

Open wommy opened this issue 3 years ago • 2 comments

  • https://www.solidjs.com/tutorial/props_children?solved
  • colored-list.tsx
Property 'forEach' does not exist on type 'Element'.
Property 'forEach' does not exist on type 'number'.(2339)

wommy avatar Feb 25 '22 00:02 wommy

@Jutanium quick fix here

davedbase avatar Mar 01 '22 12:03 davedbase

I'm not sure if this is a quick fix, we might need to add types to c in the solution - what would you suggest here?

Jutanium avatar Mar 02 '22 16:03 Jutanium

When first writing modern JavaScript you might be tempted to use one of these keywords: var, new, this, class

Hmm I disagree with this advice. new Date is the correct pattern

boehs avatar Jul 15 '22 15:07 boehs

Yeah I'll take new out of the advice at the beginning; I stand by it when writing your own Solid code (i.e., don't write code that is meant to be used by using new), but it's misleading because you don't really have a choice when consuming others' code

Jutanium avatar Jul 17 '22 15:07 Jutanium