mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-25 23:05:23 +00:00
Translate 10.5 to Korean
- Up to 60e96ed
This commit is contained in:
23
docs/10.5-clone-with-props.ko-KR.md
Normal file
23
docs/10.5-clone-with-props.ko-KR.md
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
id: clone-with-props-ko-KR
|
||||
title: ReactElement 클론하기
|
||||
permalink: clone-with-props-ko-KR.html
|
||||
prev: test-utils-ko-KR.html
|
||||
next: update-ko-KR.html
|
||||
---
|
||||
|
||||
드문 경우긴 하지만 엘리먼트에서 소유하지 않은 엘리먼트의 props를 변경하고 싶을 때가 있습니다. (`this.props.children`로 전달된 엘리먼트의 `className` 변경 같은 경우) 아니면 전달된 엘리먼트의 복사본을 여럿 만들고 싶을 수도 있습니다. 이는 `cloneWithProps()`로 할 수 있습니다.
|
||||
|
||||
#### `ReactElement React.addons.cloneWithProps(ReactElement element, object? extraProps)`
|
||||
|
||||
`element`를 얕은 복사하고 `extraProps`로 넘긴 props를 머지합니다. `className`과 `style` props는 지능적으로 머지됩니다.
|
||||
|
||||
> 주의:
|
||||
>
|
||||
> `cloneWithProps`는 `key`를 클론된 엘리먼트에 전송하지 않습니다. 키를 보존하고 싶으시면, `extraProps` 객체에 넣으세요.
|
||||
>
|
||||
> ```js
|
||||
> var clonedElement = cloneWithProps(originalElement, { key : originalElement.key });
|
||||
> ```
|
||||
>
|
||||
> 비슷하게 `ref`도 유지되지 않습니다.
|
||||
Reference in New Issue
Block a user