是否可以从React组件中的另一个文件呈现HTML?
我尝试了以下,但它不起作用:
var React = require('react');
/* Template html */
var template = require('./template');
module.exports = React.createClass({
render: function() {
return(
<template/>
);
}
});
Run Code Online (Sandbox Code Playgroud) 我尝试使用hammerjs的类型定义。作为:
import Hammer from 'hammerjs';
Run Code Online (Sandbox Code Playgroud)
但我收到此错误:
错误 TS2307:找不到模块“hammerjs”
我有两个问题。首先,有必要在github中获取所有tile定义文件,我们可以获得hammerjs的简单定义吗?
我的 package.json 包含:
"dependencies": {
"git+https://git@github.com/DefinitelyTyped/DefinitelyTyped.git"
}
Run Code Online (Sandbox Code Playgroud)
第二个问题,我关于导入模块的错误是什么?