Issues with "as" vs "is" props in V3
See original GitHub issueI noticed that the docs recommend using as
to change the underlying tag emitted. However, if I use as
instead of is, then all of the styled-system
helpers are removed, and the values are passed directly to the DOM.
i.e. this works
const Code = props =>
<Text
is='code'
fontFamily='mono'
/>
However, if we swap is
with as
, fontFamily
now gets passed as font-family
as an attribute on the tag directly. I get
<code font-family="mono" class="random-gen-class-name"></code>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:23 (5 by maintainers)
Top Results From Across the Web
Explain different ways that props are treated in v3 · Issue #1277
In v3 v-on was merged with props, for that to happen props started with on* are treated as events h(Comp, { onMyEvent...
Read more >Types issue in Vue 3 Typescript based Project - Stack Overflow
Props are declared in separate Files. Please see Below attachments: Vue component : Error on v-for loop. Props are declared in, props.ts :....
Read more >v-model breaking - Vue 3 Migration Guide
BREAKING: When used on custom components, v-model prop and event default names are changed: prop: value -> modelValue ; · BREAKING: v-bind 's...
Read more >3 Anti-Patterns to avoid in Vue.js - Binarcode
However this can create couple of issues: We mutate the prop without letting the parent now about it; We might get unexpected behavior...
Read more >Render Props - React
In this document, we'll discuss why render props are useful, and how to write your own. Use Render Props for Cross-Cutting Concerns. Components...
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 FreeTop 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
Top GitHub Comments
@jxnblk yeah, understood.
For now, we just keep our dependencies pinned to the following versions:
These do not suffer from the issue (rebass@3.0.0-9 uses it’s own css prop handling rather than relying on styled-components)
https://www.styled-components.com/docs/api#css-prop
This is different from the old rebass css prop.
Old style (expects css object):
New style (allows you to write actual css):