You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/07/13 15:45:04 UTC

[GitHub] [airflow] ryanahamilton commented on a diff in pull request #25003: Refactor js file structure

ryanahamilton commented on code in PR #25003:
URL: https://github.com/apache/airflow/pull/25003#discussion_r920236200


##########
airflow/www/static/js/App.tsx:
##########
@@ -61,16 +51,24 @@ const queryClient = new QueryClient({
   },
 });
 
+interface ChildrenProps {
+  children: React.ReactNode;
+}
+
+interface AppProps extends ChildrenProps {

Review Comment:
   ```suggestion
   interface AppProps extends PropsWithChildren {
   ```



##########
airflow/www/static/js/App.tsx:
##########
@@ -61,16 +51,24 @@ const queryClient = new QueryClient({
   },
 });
 
+interface ChildrenProps {
+  children: React.ReactNode;
+}
+
+interface AppProps extends ChildrenProps {
+  cache: EmotionCache;
+}
+
 // Chakra needs to access the containerRef provider so our tooltips pick up the correct styles
-const ChakraApp = () => {
+const ChakraApp = ({ children }: ChildrenProps) => {

Review Comment:
   You can import `PropsWithChildren` from React to simplify a bit:
   
   ```tsx
   import React, { PropsWithChildren } from 'react';
   ```
   
   ```suggestion
   const ChakraApp = ({ children }: PropsWithChildren) => {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org