Comments (5)
快速开始的问题
- 在.babelrc配置了"pragma": "Nerv.createElement"后
其实 <div class="t" />
会被编译成 Nerv.createElement('div', { class: 't' })
。只要你使用了 JSX,不管是 React 还是 Vue 还是 Nerv 都需要导入一个 JSX 的构造函数。
readme 中的一些问题
- es5-polyfill无用
unpkg 的 CDN (https://unpkg.com/es5-polyfill) 可以拿到他的入口文件,说明应该包本身没有问题。不知道你是否混用了 npm
和 cnpm
或者 yarn
- .babelrc 配置 preset-es3报错
考虑使用这个模板: https://github.com/NervJS/nerv-webpack-boilerplate
使用过程中
- 配合 react-router
希望新开一个 issue,给一个简单的复现,不然我们也不知道具体情况是怎么回事。
from nerv.
es5-polyfill无用纯粹是我require的时候写错了, 写成了 es5-polifill...不好意思 😥
react-router我再确认下, 如果有问题就另提 issue
from nerv.
@yuche 另外, 直接 require('es5-polyfill')
后, 在 chrome 和 firefox 下均报错, 错误行位于: polyfill.js 1253
document.head = document.head || document.getElementsByTagName('head')[0]; // HTML Tag shiv
chrome 下报: Uncaught TypeError: Cannot assign to read only property 'head' of object '#'
firefox: TypeError: setting getter-only property "head"
from nerv.
@wslx520 试了一下,不会报错请问chrome/ff的版本是多少
from nerv.
`按照教程的配置
import React from 'react'
import ReactDOM from 'react-dom'
class App extends React.Component {
constructor () {
super(...arguments)
this.state = {}
}
render () {
return (
)
}
}
ReactDOM.render(, document.getElementById('app'))
报错Nerv is not defined 而
import Nerv from 'nervjs'
class App extends Nerv.Component {
constructor () {
super(...arguments)
this.state = {}
}
render () {
return (
)
}
}
Nerv.render(, document.getElementById('app'))就不会 alias和babel已经设置了
resolve: {
alias: {
'react': 'nervjs',
'react-dom': 'nervjs'
},
"plugins": [
[
"@babel/plugin-transform-react-jsx",
{
"pragma": "Nerv.createElement"
}
]
]`
from nerv.
Related Issues (20)
- jest 多个Effect的时候报错
- jest useEffect中 代码没执行
- [Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL> HOT 1
- 请问现在最新版还能兼容IE8否 HOT 1
- redux无法在ie8 下使用
- this.forceUpdate()
- devtools error HOT 1
- react hooks support? HOT 1
- [bug] portal里的事件没有正确冒泡 events triggered in portal are not propagated
- Suspense / Lazy Support HOT 3
- nervjs1.4.0版本之后safari浏览器,iphone webview里input中文输入异常
- setState的回调函数中再次setState,第二个setState回调函数无法及时获取设置后的值 HOT 4
- nerv和百度地图js sdk 一起使用的时候会死循环
- 【讨论贴】给React加上强制刷新,是种什么体验? HOT 3
- nervjs 1.5.7 typings 路径错误 HOT 1
- nerv-test-utils的api:findRenderedDOMComponentWithClass问题
- [Version 1.5.7] cannot resolve the typing file
- Is that the project name got from EVA? NERV -_-!
- classComponent
- 无法兼容ie8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nerv.