python-react:服务器端渲染组件

时间:2024-04-25 05:57:30
【文件属性】:

文件名称:python-react:服务器端渲染组件

文件大小:108KB

文件格式:ZIP

更新时间:2024-04-25 05:57:30

Python

pythonReact 使用Python系统中的数据在React组件的服务器端渲染 from react . render import render_component rendered = render_component ( '/path/to/component.jsx' , { 'foo' : 'bar' , 'woz' : [ 1 , 2 , 3 ], } ) print ( rendered ) 有关客户端集成,请参阅 。 文献资料 安装 pip install react 基本用法 python-react提供了一个渲染服务器接口,该服务器能够使用来自python进程的数据渲染React组件。 渲染请求应提供导出React组件的JS文件的路径。 如果要将数据传递给组件,则可以选择提供第二个参数,该参数将用作组件的


【文件预览】:
python-react-master
----setup.py(516B)
----.gitignore(709B)
----.babelrc(44B)
----package.json(288B)
----requirements.txt(104B)
----.travis.yml(665B)
----MANIFEST.in(83B)
----CHANGELOG.md(8KB)
----LICENSE.txt(1KB)
----examples()
--------README.md(572B)
--------frontend-rendering-with-webpack()
--------Tornado-example()
--------basic_rendering()
----README.md(12KB)
----tests()
--------components()
--------test_rendering.py(5KB)
--------django_test_app()
--------__init__.py(750B)
--------perf.py(1KB)
--------test_server.js(1KB)
--------test_django_integration.py(1KB)
--------settings.py(983B)
----runtests.py(764B)
----react()
--------conf.py(1KB)
--------__init__.py(68B)
--------apps.py(310B)
--------render.py(619B)
--------render_server.py(3KB)
--------exceptions.py(150B)

网友评论