Skip to content

Commit

Permalink
Update iterable name and check
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Dec 10, 2024
1 parent 53fb446 commit 2470f6b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/interactivity/src/directives.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -567,19 +567,19 @@ export default () => {
const [ entry ] = each;
const { namespace } = entry;

const list = evaluate( entry );
const iterable = evaluate( entry );

if ( typeof iterable?.[ Symbol.iterator ] !== 'function' ) {
return;
}

const itemProp = isNonDefaultDirectiveSuffix( entry )
? kebabToCamelCase( entry.suffix )
: 'item';

if ( ! list || ! ( Symbol.iterator in list ) ) {
return;
}

const result: VNode< any >[] = [];

for ( const item of list ) {
for ( const item of iterable ) {
const itemContext = proxifyContext(
proxifyState( namespace, {} ),
inheritedValue.client[ namespace ]
Expand Down

0 comments on commit 2470f6b

Please sign in to comment.