import React , { ReactElement } from 'react' ; import RevealProvider , { RevealProviderProps } from './RevealProvider' ; import SequenceElement from './SequenceElement' ; export const RevealElements = ( { elements , children , ... rest } ) => { return ( < RevealProvider { ... rest } > { elements . map ( ( elem , index ) => { return ( < SequenceElement index = { index } key = { index } > { children ( elem , index ) } < /SequenceElement>); } ) } < /RevealProvider>); } ; export default RevealElements ;