Browse Source

div组件增加key

visuddhinanda 3 years ago
parent
commit
6291aac610
1 changed files with 5 additions and 1 deletions
  1. 5 1
      dashboard/src/components/article/RightPanel.tsx

+ 5 - 1
dashboard/src/components/article/RightPanel.tsx

@@ -13,6 +13,7 @@ interface IWidget {
   articleId: string;
   articleId: string;
   selectedChannelKeys?: string[];
   selectedChannelKeys?: string[];
   onChannelSelect?: Function;
   onChannelSelect?: Function;
+  channelReload?: boolean;
 }
 }
 const Widget = ({
 const Widget = ({
   curr = "close",
   curr = "close",
@@ -20,6 +21,7 @@ const Widget = ({
   articleId,
   articleId,
   onChannelSelect,
   onChannelSelect,
   selectedChannelKeys,
   selectedChannelKeys,
+  channelReload = false,
 }: IWidget) => {
 }: IWidget) => {
   const [dict, setDict] = useState("none");
   const [dict, setDict] = useState("none");
   const [channel, setChannel] = useState("none");
   const [channel, setChannel] = useState("none");
@@ -42,8 +44,9 @@ const Widget = ({
   }, [curr]);
   }, [curr]);
   return (
   return (
     <Affix offsetTop={44}>
     <Affix offsetTop={44}>
-      <div>
+      <div key="panel">
         <div
         <div
+          key="DictComponent"
           style={{
           style={{
             width: 350,
             width: 350,
             height: `calc(100vh - 44px)`,
             height: `calc(100vh - 44px)`,
@@ -54,6 +57,7 @@ const Widget = ({
           <DictComponent />
           <DictComponent />
         </div>
         </div>
         <div
         <div
+          key="ChannelPickerTable"
           style={{
           style={{
             width: 350,
             width: 350,
             height: `calc(100vh - 44px)`,
             height: `calc(100vh - 44px)`,