Unverified Commit f544a90c authored by John Daly's avatar John Daly Committed by GitHub

Update with-emotion-swc to use TypeScript (#38744)

* Updating the with-emotion-swc example to use TypeScript

* Updating dependencies

* Adding @types packages for react and react-dom

* Adding @types/node
parent b9791bf9
......@@ -32,3 +32,6 @@ yarn-error.log*
# vercel
.vercel
# typescript
*.tsbuildinfo
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
......@@ -6,10 +6,16 @@
"start": "next start"
},
"dependencies": {
"@emotion/react": "11.8.1",
"@emotion/styled": "11.8.1",
"@emotion/react": "11.9.3",
"@emotion/styled": "11.9.3",
"next": "latest",
"react": "17.0.2",
"react-dom": "17.0.2"
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@types/node": "18.0.6",
"@types/react": "18.0.15",
"@types/react-dom": "18.0.6",
"typescript": "^4.7.4"
}
}
import { css, Global, keyframes } from '@emotion/react'
import { css, Global, keyframes, Keyframes } from '@emotion/react'
import styled from '@emotion/styled'
export const globalStyles = (
......@@ -71,7 +71,7 @@ export const ComponentSelectorsExtended = styled.div`
box-shadow: -5px -5px 0 0 green;
`
export const Animated = styled.div`
export const Animated = styled.div<{ animation: Keyframes }>`
${basicStyles};
${hoverStyles};
& code {
......
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"jsxImportSource": "@emotion/react"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment