瀏覽代碼

docs: modify jsonviewer api desc (#2701)

Co-authored-by: 田丰 <[email protected]>
田丰 7 月之前
父節點
當前提交
e727d9a6ad
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 1 0
      content/plus/jsonviewer/index-en-US.md
  2. 2 1
      content/plus/jsonviewer/index.md

+ 1 - 0
content/plus/jsonviewer/index-en-US.md

@@ -36,6 +36,7 @@ import { JsonViewer } from '@douyinfe/semi-ui';
 ### Basic Usage
 ### Basic Usage
 
 
 Basic usage of JsonViewer. Pass in the `height` and `width` parameters to set the height, width and initial value of the component. Pass in the JSON string through the `value`.
 Basic usage of JsonViewer. Pass in the `height` and `width` parameters to set the height, width and initial value of the component. Pass in the JSON string through the `value`.
+Note: JsonViewer is an uncontrolled component. If the value prop is passed as a controlled property (i.e., React State), it is not recommended to modify the value prop (setState) in onChange. If you need to get the component's value, you can get it through ref, please refer to [Methods](#Methods) for details.
 
 
 ```jsx live=true dir="column" noInline=true
 ```jsx live=true dir="column" noInline=true
 import React from 'react';
 import React from 'react';

+ 2 - 1
content/plus/jsonviewer/index.md

@@ -31,7 +31,8 @@ import { JsonViewer } from '@douyinfe/semi-ui';
 
 
 ### 基本用法
 ### 基本用法
 
 
-JsonViewer 的基本用法。传入 height 和 width 参数,设置组件的高度和宽度和初始值。通过 value 传入 Json 字符串
+JsonViewer 的基本用法。传入 height 和 width 参数,设置组件的高度和宽度和初始值。通过 value 传入 Json 字符串  
+注意:JsonViewer 为非受控组件,若传入 value 属性为受控属性即React State,不建议在 onChange 中修改 value 属性即setState操作。若需要获取组件的值,可以通过 ref 获取,具体可参考 [Methods](#Methods)。
 
 
 ```jsx live=true dir="column" noInline=true
 ```jsx live=true dir="column" noInline=true
 import React from 'react';
 import React from 'react';