Tag: reactjs

Office结构ui节点服务器中的服务器端呈现

我正在做一个单一的MERN应用程序的培训,我虽然使用Office Frabric UI可能是一个好主意。 我正在使用服务器端渲染为我的应用程序,但我收到此错误时,我使用一个<Fabric>组件: /home/salahaddin/Proyectos/Tutorials/full-stack-js-lynda/node_modules/@microsoft/load-themed-styles/lib/index.js:277 var head = document.getElementsByTagName('head')[0]; ^ ReferenceError: document is not defined at registerStyles (/home/salahaddin/Proyectos/Tutorials/full-stack-js-lynda/node_modules/@microsoft/load-themed-styles/lib/..\src/index.ts:390:33) at applyThemableStyles (/home/salahaddin/Proyectos/Tutorials/full-stack-js-lynda/node_modules/@microsoft/load-themed-styles/lib/..\src/index.ts:243:7) at /home/salahaddin/Proyectos/Tutorials/full-stack-js-lynda/node_modules/@microsoft/load-themed-styles/lib/..\src/index.ts:183:7 at measure (/home/salahaddin/Proyectos/Tutorials/full-stack-js-lynda/node_modules/@microsoft/load-themed-styles/lib/..\src/index.ts:121:3) at Object.loadStyles (/home/salahaddin/Proyectos/Tutorials/full-stack-js-lynda/node_modules/@microsoft/load-themed-styles/lib/..\src/index.ts:167:3) at Object.<anonymous> (/home/salahaddin/Proyectos/Tutorials/full-stack-js-lynda/node_modules/@uifabric/utilities/src/scroll.scss.ts:3:1) at Module._compile (module.js:641:30) at Module._extensions..js (module.js:652:10) at Object.require.extensions.(anonymous function) [as .js] (/home/salahaddin/Proyectos/Tutorials/full-stack-js-lynda/node_modules/babel-register/lib/node.js:152:7) at Module.load (module.js:560:32) [nodemon] app crashed – waiting for file changes […]

Webpack不会重新加载页面

npm run dev工作正常,但它不会重新加载页面进行更改时。 我也尝试使用localhost:8080/webpack-dev-server/index.html并且页面不再刷新。 我完全是NodeJS的新手,完全不知道如何解决这个问题。 我花了几个小时尝试不同的事情,因为这很困难,我差点stream泪。 文件夹结构: Project – node_modules – src – js – components – pages – client.min.js – index.html – package.json – package-lock.json – webpack.config.js 的package.json: { "name": "react-tutorials", "version": "0.0.0", "description": "", "main": "webpack.config.js", "dependencies": { "babel-core": "^6.17.0", "babel-loader": "^6.2.0", "babel-plugin-add-module-exports": "^0.1.2", "babel-plugin-react-html-attrs": "^2.0.0", "babel-plugin-transform-class-properties": "^6.3.13", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-preset-es2015": "^6.3.13", "babel-preset-react": […]

在AWS上部署反应Web应用程序

我期待在AWS上部署我的nodejs React Web应用程序。 目前,我在微软的Azure上部署了我的应用程序,这非常简单。 我只需要添加一个应用程序服务,并给我的git存储库作为源。 这照顾了托pipe我的应用程序。 我没有办法像在AWS上那样做。 我正在寻找类似的东西。 我应该如何在AWS中做到这一点?

SSL证书 – 禁用axios中的validation并作出反应

我试图在使用axios的应用程序中使用API​​。 该API通过使用自签名证书的HTTPS进行工作。 到目前为止,连接时出现以下错误: net::ERR_INSECURE_RESPONSE bundle.js:65253 HTTP Failure in Axios Error: Network Error at createError (bundle.js:2188) at XMLHttpRequest.handleError (bundle.js:1717) 我尝试了以下,但没有成功: import axios from 'axios'; const https = require('https'); const agent = new https.Agent({ rejectUnauthorized: false, }); const client = axios.create({ //all axios can be used, shown in axios documentation baseURL: process.env.REACT_APP_API_URL, responseType: 'json', withCredentials: true, httpsAgent: […]

React没有导出的成员LinkHTMLAttributes

我正在使用vs2017,npm和webpack构build一个反应的应用程序。 由于在我的标题中描述的错误,我无法获得vs构build我的解决scheme: 错误TS2694 Build:Namespace'React'没有导出的成员'LinkHTMLAttributes'。 SpyStore.React C:\ Work \ Development \ React \ Spystore \ SpyStore.React \ SpyStore.React \ node_modules \ @types \ react-router \ lib \ Link.d.ts 10 Js文件:\ node_modules \ @types \ react-router \ lib \ Link.d.ts import * as React from 'react'; import Router from './Router'; declare const Link: Link; type Link = […]

反应与快速后端和快速应用程序的应用程序

我目前有一个React应用程序(通过create-react-app )和一个用于我的API调用的Express服务器。 他们都分开运行,一直工作正常,直到我碰到这个问题: 我也使用express-session和passport进行用户authentication。 我能够authentication用户,但会话不会持续在API调用之间。 如果我成功login,下次进行API调用时, req.sessionID将会不同, req.isAuthenticated()将返回false 。 这是我的服务器代码: 'use strict' var express = require('express'); var path = require('path'); var bodyParser = require('body-parser'); var cookieParser = require('cookie-parser'); var mongoose = require('mongoose'); var passport = require('passport'); var session = require('express-session'); var cors = require('cors'); var flash = require('connect-flash'); var store = require('./store'); var database = […]

为什么不反应游戏套件应用程序在heroku中工作?

我已经部署反应游戏套件到Heroku。 但是,在部署成功后,加载应用程序URL时出现此错误(例如: https : //jincowboy-okan.herokuapp.com/ ) 应用程序错误 应用程序发生错误,您的页面无法送达。 如果您是应用程序所有者,请查看日志以获取详细信息。

App组件刷新时丢失currentUser?

我目前正在使用React, Node.js ,passport-google-oauth20来开发一个简单的web应用程序。 出于某种原因,无论何时应用程序重新装入,我都将失去当前的用户状态。 就好像req.user只是丢失了一样。 它的工作方式是当应用程序挂载时,首先获取当前用户,并将this.state.currentUser设置为结果。 问题是页面刷新的时候。 组件重新挂载,我失去了用户。 我试图logging用户,并收到空。 希望我解释得很好…这是代码: 应用组件: import React from 'react'; import List from './List'; import ListForm from './ListForm'; import * as helpers from '../helpers'; class App extends React.Component{ state = { currentUser: '', } componentDidMount() { helpers.fetchUser() .then(data => { this.setState({ currentUser: data }); }); } onSubmit = (id, item) […]

在WebView中反应ssr速度

我使用ReactJS创build了一个反应式Web应用程序。 它可以做SSR 。 每个浏览器都可以,但是只能在webview中缓慢加载 它只发生在ReactJS 。 spring开发的Web应用程序没有这个问题。 它可以一次加载页面。 这意味着,每个内容都一次出现(图像除外)。 但是这个ReactJS应用程序(使用Node )不是。 即使认为它是文本,它不是一次加载…它一步一步加载。 我们的应用链接是https://play.google.com/store/apps/details?id=com.seeon.hotplace&hl=ko 如果你有时间,请检查我的应用程序的现象 input应用程序,然后点击任何图片。 那么你可以看到我说的这个现象。 那么..我要检查什么? 我真的想解决这个现象,但是我不知道该怎么检查。

反应reduxasynchronousmapStateToProps

当在componentDidMount , mapStateToProps调用mapDispatchToProps函数的时候, mapStateToProps totalDoctorCount: state.doctors.totalDoctorCount不会总是按时加载,我会在console.log("this.props.totalDoctorCount: "+this.props.totalDoctorCount );得到undefined结果console.log("this.props.totalDoctorCount: "+this.props.totalDoctorCount ); 。 我知道这是async的本质,但有没有办法解决这个问题,我在这里做错了什么。 完整代码: doctorActions export function getDoctors(filterType){ return function(dispatch){ axios.get("/api/doctors/"+filterType) .then(function(response){ dispatch({type:"GET_DOCTORS",payload:response.data}); }) .catch(function(err){ dispatch({type:"GET_DOCTORS_REJECTED",payload:err}); }) } } export function getTotalDoctors(){ return function(dispatch){ axios.get("/api/getTotalDoctors/") .then(function(response){ dispatch({type:"TOTAL_DOCTORS",payload:response.data}); console.log(response.data); }) .catch(function(err){ //console.log(err); dispatch({type:"TOTAL_DOCTORS_REJECTED",payload:"there was an error rortal doctors"}); }) } } doctorReducer export function doctorsReducers(state={ doctors:[], }, […]