refactor: convert function expressions to declarations (#4926)
This commit is contained in:
committed by
GitHub
parent
c0236536dd
commit
141a2eba56
@ -2,7 +2,9 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { WidgetPreviewContainer } from 'netlify-cms-ui-default';
|
||||
|
||||
const TextPreview = ({ value }) => <WidgetPreviewContainer>{value}</WidgetPreviewContainer>;
|
||||
function TextPreview({ value }) {
|
||||
return <WidgetPreviewContainer>{value}</WidgetPreviewContainer>;
|
||||
}
|
||||
|
||||
TextPreview.propTypes = {
|
||||
value: PropTypes.node,
|
||||
|
@ -1,12 +1,14 @@
|
||||
import controlComponent from './TextControl';
|
||||
import previewComponent from './TextPreview';
|
||||
|
||||
const Widget = (opts = {}) => ({
|
||||
name: 'text',
|
||||
controlComponent,
|
||||
previewComponent,
|
||||
...opts,
|
||||
});
|
||||
function Widget(opts = {}) {
|
||||
return {
|
||||
name: 'text',
|
||||
controlComponent,
|
||||
previewComponent,
|
||||
...opts,
|
||||
};
|
||||
}
|
||||
|
||||
export const NetlifyCmsWidgetText = { Widget, controlComponent, previewComponent };
|
||||
export default NetlifyCmsWidgetText;
|
||||
|
Reference in New Issue
Block a user