Skip to content

Commit

Permalink
fix(preactjs#2644): adapt the react children api
Browse files Browse the repository at this point in the history
  • Loading branch information
deleonio committed Jul 22, 2020
1 parent 020d5e5 commit 867fd81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compat/src/Children.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { toChildArray } from 'preact';

const mapFn = (children, fn) => {
const mapFn = (children, fn, context) => {
if (!children) return null;
return toChildArray(children).reduce(
(acc, value, index) => acc.concat(fn(value, index)),
(acc, value, index) => acc.concat(fn(context, value, index)),
[]
);
};
Expand Down

0 comments on commit 867fd81

Please sign in to comment.