-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pageLayout): apply basic strict typing
- Loading branch information
1 parent
c030db2
commit 737c5b0
Showing
1 changed file
with
8 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
import Layout from '@/components/core/Layout/Layout'; | ||
// @flow strict | ||
import type { AbstractComponent } from 'react'; | ||
|
||
function pageLayout<Config: {}>( | ||
Component: AbstractComponent<Config> | ||
): AbstractComponent<Config> { | ||
return Component; | ||
} | ||
|
||
function withSubscription(WrappedComponent) { | ||
// ...and returns another component... | ||
return class extends React.Component { | ||
|
||
render() { | ||
// ... and renders the wrapped component with the fresh data! | ||
// Notice that we pass through any additional props | ||
return <WrappedComponent data={this.state.data} {...this.props} />; | ||
} | ||
}; | ||
} | ||
export default pageLayout; |