【问题标题】:Passing props to bundle.js - React and Spring Boot将 props 传递给 bundle.js - React 和 Spring Boot
【发布时间】:2020-02-05 01:12:37
【问题描述】:

我有点卡住了,需要一些帮助。我遵循了 Spring Boot 和 React 教程,链接 - http://spring.io/guides/tutorials/react-and-spring-data-rest/ 并成功地集成了 Spring Boot 和 React。但是我现在有一个要求,我需要将参数从我的 html 页面传递给 React 组件到 React 组件(详细信息,如 userId、URL 等)?如何将参数传递给预编译的 bundle.js 并依次传递给 react 组件?这就是我在 index.html 中的脚本标签当前的样子。

<div id="react"></div>
<script src="built/index.bundle.js"></script>

任何帮助将不胜感激。

【问题讨论】:

    标签: javascript reactjs spring spring-boot


    【解决方案1】:

    抱歉,在发布查询之前应该再做一些谷歌搜索。发布答案以防有人偶然发现相同的问题。

    Chris Unsell 在这里的回答 How to pass props from template to react root node? 帮助我弄清楚了。

    【讨论】:

      猜你喜欢
      • 2019-08-11
      • 2023-03-08
      • 2021-03-17
      • 2021-09-17
      • 1970-01-01
      • 2017-11-17
      • 1970-01-01
      • 2017-09-14
      • 2020-04-10
      相关资源
      最近更新 更多