Apply `as` in advance
See original GitHub issueI’m looking to achieve something similar to styled(Component). I really need to find out the types for the props when as is applied.
// imagine this does something fancy or stateful
const MyComponent = (props) => <div {...props} />;
const Box = createBoxWithAtomsProp(atoms);
const AsBox = (props/*: Calculate Me */) => <Box {...props} as={MyCompent} />
Trying a few things with little success.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
apply in advance to | English examples in context - Ludwig
High quality example sentences with “apply in advance to” in context from reliable sources - Ludwig is the linguistic search engine that helps...
Read more >Advance Auto Parts Careers
A World In Motion. Don't miss your next opportunity. Advance Auto Parts' Talent Network sends career alerts for new positions that match your...
Read more >I-131, Application for Travel Document - USCIS
Use this form to apply for a re-entry permit, refugee travel document, TPS travel authorization document, advance parole travel document ...
Read more >Advance Application Definition | Law Insider
Advance Application means a writing or electronic transmission, in such form or forms as shall be specified by the Bank from time to...
Read more >Advance America: Easy and fast online cash advances, cash ...
Advance America is here to help you with easy online cash advances, fast cash loans and more. Apply online now or visit any...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@waynevanson sorry for the delay here, you can solve this by doing something like:
The important part here is using
React.ComponentPropsto get the props from bothBoxand the other component you’re interested in!Also, a
useBoxhook will be coming soon that will make using the Box props in other components a bit easier.I’d also recommend using
Boxdirectly of that other component if you’re in control of that, as Box is meant to be used as a styling primitive inside of our apps, I recommend reading the FAQ section in our READMe (just added ✨).Closing this @waynevanson, please feel free to reopen if this didn’t help.
Great work, I’ve got nothing more to add!