name | about | labels |
---|---|---|
Feature Request 💡 |
Suggest a new idea for the project. |
enhancement |
Brief explanation of the feature.
const dayjs = require('dayjs') | |
const open = require('open') | |
module.exports = { | |
prompt: ({ prompter }) => { | |
return new Promise((resolve, reject) => { | |
prompter | |
.prompt([ | |
{ | |
type: 'input', |
{ | |
"exclude": ["node_modules", "build", "public"], | |
"compilerOptions": { | |
/* Basic Options */ | |
// "incremental": true, /* Enable incremental compilation */ | |
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, | |
"module": "esnext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, | |
// "lib": [], /* Specify library files to be included in the compilation. */ | |
"allowJs": true /* Allow javascript files to be compiled. */, | |
// "checkJs": true, /* Report errors in .js files. */ |
undefined
itself but it was the closest I could find) if (typeof window !== 'undefined') {
return localStorage.getItem('theme') || 'default'
} else {
return 'default'
import React from 'react' | |
type Props = { | |
text: string; | |
color: string; | |
} | |
export const Header: React.FC<Props> = ({text, color}) => { | |
return <h1 style={{ color }}>{text}</h1> | |
} |
import React from 'react' | |
export const Header = ({text, color}) => { | |
return <h1 style={{ color }}>{text}</h1> | |
} | |
Header.defaultProps = { | |
color: 'red', | |
text: 'Hello world!' | |
} |
import React from 'react' | |
type Props = { | |
text: string; | |
color: string; | |
} | |
export const Header: React.FC<Props> = ({text = 'Hello world!', color = 'red'}) => { | |
return <h1 style={{ color }}>{text}</h1> | |
} |
import React from 'react' | |
// Written as a function declaration | |
function Heading(): React.Node { | |
return <h1>My Website Heading</h1> | |
} | |
// Written as a function expression | |
const OtherHeading: React.FC = () => <h1>My Website Heading</h1> |
import React from 'react' | |
// Written as a function declaration | |
function Heading(): React.Node { | |
return <h1>My Website Heading</h1> | |
} | |
// Written as a function expression | |
const OtherHeading: React.FC = () => <h1>My Website Heading</h1> |