我开发了一个基于Reactjs和Flux的应用程序。商店之间存在一个沟通问题:ProjectsStore和TasksStore。
在方法getAllForCurrentProject of TasksStore中,我称之为ProjectsStore.getCurrentId()。结果我得到了一个Uncaught TypeError: undefined is not a function。typeof ProjectsStore是object in getAllForCurrentProject。当我从任何组件调用ProjectsStore.getCurrentId()时,它都能正常工作。
这
我有一个问题,我想访问一个带有全局变量的DOM元素,以便在我的所有方法中使用它,我试图使用"this.refs“访问它,但它似乎只用于表单和输入?也许你知道更好的方法?下面是我的一些代码:
`从‘React’导入react;
var isSmall = false;
var isMedium = false;
var isLarge = true;
类应用程序扩展了React.Component {
openIframe()
{
var iframe = document.createElement('iframe');
var siteUrl = d
我读过关于的文章,我只读过两种在表单中管理数据的方法。
第一个是refs,在每个数据输入中输入参考文献:
class CustomTextInput extends React.Component {
constructor(props) {
super(props);
this.focus = this.focus.bind(this);
}
focus() {
// Explicitly focus the text input using the raw DOM API
this.textInput.focus();
}
rende