Преглед на файлове

fix: Add display name to components so it doesn't show as anonymous (#5616)

Aakansha Doshi преди 2 години
родител
ревизия
43b13d8e3a
променени са 4 файла, в които са добавени 6 реда и са изтрити 1 реда
  1. 1 1
      src/actions/actionExport.tsx
  2. 1 0
      src/actions/manager.tsx
  3. 2 0
      src/components/ColorPicker.tsx
  4. 2 0
      src/components/ToolButton.tsx

+ 1 - 1
src/actions/actionExport.tsx

@@ -244,7 +244,7 @@ export const actionLoadScene = register({
     }
   },
   keyTest: (event) => event[KEYS.CTRL_OR_CMD] && event.key === KEYS.O,
-  PanelComponent: ({ updateData, appState }) => (
+  PanelComponent: ({ updateData }) => (
     <ToolButton
       type="button"
       icon={load}

+ 1 - 0
src/actions/manager.tsx

@@ -147,6 +147,7 @@ export class ActionManager {
     ) {
       const action = this.actions[name];
       const PanelComponent = action.PanelComponent!;
+      PanelComponent.displayName = "PanelComponent";
       const elements = this.getElementsIncludingDeleted();
       const appState = this.getAppState();
       const updateData = (formState?: any) => {

+ 2 - 0
src/components/ColorPicker.tsx

@@ -343,6 +343,8 @@ const ColorInput = React.forwardRef(
   },
 );
 
+ColorInput.displayName = "ColorInput";
+
 export const ColorPicker = ({
   type,
   color,

+ 2 - 0
src/components/ToolButton.tsx

@@ -187,3 +187,5 @@ ToolButton.defaultProps = {
   className: "",
   size: "medium",
 };
+
+ToolButton.displayName = "ToolButton";