Skip to content

Instantly share code, notes, and snippets.

@landrysoules
Last active September 6, 2019 06:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save landrysoules/28e3bc606b968617665d0d3a8219dfb0 to your computer and use it in GitHub Desktop.
Save landrysoules/28e3bc606b968617665d0d3a8219dfb0 to your computer and use it in GitHub Desktop.
Simplifier le code sur des closures :
<FieldArray name="sections" subscription={{}}>
{({ fields }) => {
return (
<SortableContainer onSortEnd={fields.move} useDragHandle>
{fields.map((name, index) => (
<AuditModelSection
key={name}
sectionIndex={index}
index={index}
moveSection={fields.move}
/>
))}
</SortableContainer>
);
}}
</FieldArray>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment