diff --git a/notes/web/react/reactBasicNotes.md b/notes/web/react/reactBasicNotes.md
index 782c9e4c90..739975e0e9 100755
--- a/notes/web/react/reactBasicNotes.md
+++ b/notes/web/react/reactBasicNotes.md
@@ -475,6 +475,85 @@ function App() {
}
```
+#### React Children API
+
+```jsx
+import { Children, cloneElement } from 'react';
+
+function Breadcrumbs({ children }) {
+ const arrayChildren = Children.toArray(children);
+
+ return (
+
+ {Children.map(arrayChildren, (child, index) => {
+ const isLast = index === arrayChildren.length - 1;
+
+ if (!isLast && !child.props.link) {
+ throw new Error(
+ `BreadcrumbItem child no. ${index + 1}
+ should be passed a 'link' prop`
+ );
+ }
+
+ return (
+ <>
+ {child.props.link ? (
+
+
+ {cloneElement(child, {
+ isLast,
+ })}
+
+
+ ) : (
+
+ {cloneElement(child, {
+ isLast,
+ })}
+
+ )}
+ {!isLast && >
}
+ >
+ );
+ })}
+
+ );
+}
+
+function BreadcrumbItem({ isLast, children }) {
+ return (
+
+ {children}
+
+ );
+}
+
+export default function App() {
+ return (
+
+ Example
+ Hotels
+ A Fancy Hotel Name
+
+ );
+}
+```
+
### Refs
Refs 用于返回对元素的引用.