# 在React框架中使用其他模块

‌

​[示例库](https://github.com/dfinity/examples)中的一些教程和示例项目说明了如何使用npm install命令添加React模块。 您可以使用这些模块来构造要在项目中使用的用户界面组件。 例如，您可以运行以下命令来安装react-router模块：‌

**`npm install --save react react-router-dom`**&#x200C;

然后，您可以使用该模块构造类似于以下内容的导航组件：

```
import React from 'react';
import { NavLink } from 'react-router-dom';
const Navigation = () => {
 return (
 <nav className="main-nav">
 <ul>
 <li><NavLink to="/myphotos">Remember</NavLink></li>
 <li><NavLink to="/myvids">Watch</NavLink></li>
 <li><NavLink to="/audio">Listen</NavLink></li>
 <li><NavLink to="/articles">Read</NavLink></li>
 <li><NavLink to="/contribute">Write</NavLink></li>
 </ul>
 </nav>
 );
}
export default Navigation;
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mixdao.gitbook.io/dfinity/san-shou-ba-shou/5.-tian-jia-qian-duan-zi-yuan/zai-react-kuang-jia-zhong-shi-yong-qi-ta-mo-kuai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
