Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript and new React Context API #8

Closed
01e9 opened this issue Apr 2, 2020 · 1 comment
Closed

TypeScript and new React Context API #8

01e9 opened this issue Apr 2, 2020 · 1 comment

Comments

@01e9
Copy link

01e9 commented Apr 2, 2020

I refactored this lib https://www.npmjs.com/package/@01e9/react-page-layout (I just finished, improvements will come later)

Let me know if you are interested to accept a big pull request and continue maintaining the lib, then I will remove it from my account. Or you can add a "deprecated" warning in your README and a link to my fork.

@01e9
Copy link
Author

01e9 commented Jun 12, 2020

Layouts with "slots" as ComponentProps/FunctionalProps seems to be enough for me

type LayoutProps = {
  Slot1: React.JSXElementConstructor<{}>;
  Slot2: React.JSXElementConstructor<{}>;
};

const Layout: React.FC<LayoutProps> = ({ Slot1, Slot2 }) => (
  <div>
    <div><Slot1 /></div>
    <div>
      <div><Slot2 /></div>
    </div>
  </div>
);

So I will stop using react-page-layout (and maybe delete my fork).

@01e9 01e9 closed this as completed Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant