Skip to content

Commit 0facbe4

Browse files
ZachRiegelAndarist
andauthored
Renamed default-exported variable in @emotion/styled to aid inferred import names in auto-import completions in IDEs (#3334)
* Rename default exported variable so editors can correctly autocomplete the import * add changeset * Apply suggestions from code review * Apply suggestions from code review * Update .changeset/wild-pumas-smash.md --------- Co-authored-by: Mateusz Burzyński <[email protected]>
1 parent cce67ec commit 0facbe4

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changeset/wild-pumas-smash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/styled': patch
3+
---
4+
5+
Renamed default-exported variable in `@emotion/styled` to aid inferred import names in auto-import completions in IDEs

packages/styled/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Theme } from '@emotion/react'
2-
import styled from './base'
2+
import baseStyled from './base'
33
import { ReactJSXIntrinsicElements } from './jsx-namespace'
44
import { tags } from './tags'
55
import {
@@ -33,10 +33,10 @@ export type StyledTags = {
3333
export interface CreateStyled extends BaseCreateStyled, StyledTags {}
3434

3535
// bind it to avoid mutating the original function
36-
const newStyled = styled.bind(null) as CreateStyled
36+
const styled = baseStyled.bind(null) as CreateStyled
3737

3838
tags.forEach(tagName => {
39-
;(newStyled as any)[tagName] = newStyled(tagName as keyof typeof newStyled)
39+
;(styled as any)[tagName] = styled(tagName as keyof typeof styled)
4040
})
4141

42-
export default newStyled
42+
export default styled

0 commit comments

Comments
 (0)