Skip to content
Snippets Groups Projects
Unverified Commit 7a45d467 authored by Matiss Janis Aboltins's avatar Matiss Janis Aboltins Committed by GitHub
Browse files

:recycle: (eslint) enable 'react/no-children-prop' rule and fix issues (#2029)

parent 79aa07ff
No related branches found
No related tags found
No related merge requests found
Showing
with 36 additions and 27 deletions
......@@ -82,7 +82,6 @@ module.exports = {
// TODO: re-enable these rules
'react-hooks/exhaustive-deps': 'off',
'react/no-children-prop': 'off',
'react/display-name': 'off',
'react/react-in-jsx-scope': 'off',
// 'react-hooks/exhaustive-deps': [
......
......@@ -124,11 +124,9 @@ function NotesTooltip({
/>
) : (
<Text {...markdownStyles}>
<ReactMarkdown
remarkPlugins={remarkPlugins}
linkTarget="_blank"
children={notes}
/>
<ReactMarkdown remarkPlugins={remarkPlugins} linkTarget="_blank">
{notes}
</ReactMarkdown>
</Text>
)}
</Tooltip>
......
......@@ -42,10 +42,9 @@ export default function ScrollProvider({ children }: ScrollProviderProps) {
}, []);
return (
<ScrollContext.Provider
value={{ scrollY, isBottomReached }}
children={children}
/>
<ScrollContext.Provider value={{ scrollY, isBottomReached }}>
{children}
</ScrollContext.Provider>
);
}
......
......@@ -78,10 +78,9 @@ export function TitlebarProvider({ children }: TitlebarProviderProps) {
}
return (
<TitlebarContext.Provider
value={{ sendEvent, subscribe }}
children={children}
/>
<TitlebarContext.Provider value={{ sendEvent, subscribe }}>
{children}
</TitlebarContext.Provider>
);
}
......
......@@ -26,8 +26,9 @@ export function ReportProvider({
onBudgetAction,
onToggleSummaryCollapse,
}}
children={children}
/>
>
{children}
</Context.Provider>
);
}
......
......@@ -29,8 +29,9 @@ export function RolloverContext({
onBudgetAction,
onToggleSummaryCollapse,
}}
children={children}
/>
>
{children}
</Context.Provider>
);
}
......
......@@ -340,10 +340,8 @@ export function SelectedProviderWithItems<T extends Item>({
}, [registerDispatch]);
return (
<SelectedProvider<T>
instance={selected}
fetchAllIds={fetchAllIds}
children={children}
/>
<SelectedProvider<T> instance={selected} fetchAllIds={fetchAllIds}>
{children}
</SelectedProvider>
);
}
......@@ -13,7 +13,9 @@ const AccountsContext = createContext<AccountEntity[]>(null);
export function AccountsProvider({ children }) {
const data = useAccounts();
return <AccountsContext.Provider value={data} children={children} />;
return (
<AccountsContext.Provider value={data}>{children}</AccountsContext.Provider>
);
}
export function CachedAccounts({ children, idKey }) {
......
......@@ -13,7 +13,9 @@ const PayeesContext = createContext<PayeeEntity[]>(null);
export function PayeesProvider({ children }) {
const data = usePayees();
return <PayeesContext.Provider value={data} children={children} />;
return (
<PayeesContext.Provider value={data}>{children}</PayeesContext.Provider>
);
}
export function CachedPayees({ children, idKey }) {
......
......@@ -69,7 +69,11 @@ const SchedulesContext = createContext(null);
export function SchedulesProvider({ transform, children }) {
const data = useSchedules({ transform });
return <SchedulesContext.Provider value={data} children={children} />;
return (
<SchedulesContext.Provider value={data}>
{children}
</SchedulesContext.Provider>
);
}
export function useCachedSchedules() {
......
......@@ -46,7 +46,7 @@ function makeContext(queryState, opts, QueryClass) {
};
}, []);
return <Context.Provider value={value} children={children} />;
return <Context.Provider value={value}>{children}</Context.Provider>;
}
function useQuery() {
......
---
category: Maintenance
authors: [MatissJanis]
---
Enable `react/no-children-prop` rule and fix the issues
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment