Skip to content

Commit c212942

Browse files
author
Damian Sznajder
committed
fix: components
1 parent fa00128 commit c212942

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/sourceSnippets/components.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ const reactFunctionMemoComponent: ComponentsSnippet = {
228228
body: [
229229
...reactWithMemo,
230230
'',
231-
`export default memo(function ${Placeholders.FileName}() {`,
231+
`const ${Placeholders.FileName} = memo(() => {`,
232232
...innerComponent,
233233
'})',
234-
'',
234+
...exportDefault,
235235
],
236236
description: 'Creates a React Memo Function Component with ES7 module system',
237237
};
@@ -243,7 +243,7 @@ const reactFunctionMemoComponentWithPropTypes: ComponentsSnippet = {
243243
"import PropTypes from 'prop-types'",
244244
...reactWithMemo,
245245
'',
246-
`const ${Placeholders.FileName} = memo(function ${Placeholders.FileName}(props) {`,
246+
`const ${Placeholders.FileName} = memo((props) => {`,
247247
...innerComponent,
248248
'})',
249249
'',

0 commit comments

Comments
 (0)