Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translation 4 files to Ko #22

Merged
merged 3 commits into from
Feb 7, 2021
Merged

Conversation

paigekim29
Copy link
Contributor

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2021

Thanks for the PR!

This section of the codebase is owned by @bumkeyy, @yeonjuan, and @guyeol - if they write a comment saying "LGTM" then it will be merged.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2021

Translation of jsxImportSource.md

display: "jsxImportSource"

oneline: "Specify module specifier used to import the JSX factory functions when using jsx: react-jsx*.`"

Introduced in Typescript 4.1 version jsxthe "react-jsx" Or "react-jsxdev"when used as a jsx And jsxs Declares the module designee to use to import the factory function.

React 17In , the library supports a new form of JSX conversion through an independent import.

For example:

import React from "react";

function App() {
  return <h1>Hello World</h1>;
}

When using TSConfig:

{
  "compilerOptions": {
    "target": "esnext",
    "module": "commonjs",
    "jsx": "react-jsx"
  }
}

JavaScript compiled from TypeScript is:

// @showEmit
// @noErrors
// @jsx: react-jsx
// @module: commonjs
// @target: esnext
declare module JSX {
  interface Element {}
  interface IntrinsicElements {
    [s: string]: any;
  }
}
import React from "react";

function App() {
  return <h1>Hello World</h1>;
}

For example "jsxImportSource": "preact"If you would like to use , you can use the following tsconfig:

{
  "compilerOptions": {
    "target": "esnext",
    "module": "commonjs",
    "jsx": "react-jsx",
    "jsxImportSource": "preact",
    "types": ["preact"]
  }
}

Generate the following code:

// @showEmit
// @jsxImportSource: preact
// @types: preact
// @jsx: react-jsx
// @target: esnext
// @module: commonjs
// @noErrors

export function App() {
  return <h1>Hello World</h1>;
}

Alternatively, you can use per-file pragma per-file to set the following options:

/** @jsxImportSource preact */

export function App() {
  return <h1>Hello World</h1>;
}

_jsxAs an import for factories preact/jsx-runtimeAdd .

Notes: To work as intended: tsxThe file export Or importis considered a module only if you add .

Translation of top_level.md

Root Fields

Getting started with TSConfig is the root option - this option is related to setting up a TypeScript or JavaScript project.

Generated by 🚫 dangerJS against 0053c6e

@orta
Copy link
Contributor

orta commented Feb 1, 2021

I'll need to fix that CI issue 👍🏻 consider it green

Copy link
Contributor

@yeonjuan yeonjuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paigekim29 PR 감사합니다.. 어색한 부분이나 오역, 맞춤법 수정해 봤습니다 :)

docs/tsconfig/ko/sections/top_level.md Outdated Show resolved Hide resolved
docs/playground/ko/3-7/Fixits/Infer From Usage Changes.ts Outdated Show resolved Hide resolved
docs/playground/ko/3-7/Fixits/Infer From Usage Changes.ts Outdated Show resolved Hide resolved
docs/tsconfig/ko/options/jsxImportSource.md Outdated Show resolved Hide resolved
docs/tsconfig/ko/options/jsxImportSource.md Outdated Show resolved Hide resolved
Copy link
Contributor

@yeonjuan yeonjuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paigekim29 PR 감사합니다 :)

@yeonjuan
Copy link
Contributor

yeonjuan commented Feb 7, 2021

LGTM

@github-actions github-actions bot merged commit 5785c8d into microsoft:main Feb 7, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2021

Merging because @yeonjuan is a code-owner of all the changes - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants