![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
intact-react
Advanced tools
- 在react 项目中运行intact组件
- 理论上支持所有react 版本 , 本项目测试用例使用
react 16
intact
构造函数, react 调用实例化时 , 判断调用者为react时 ,还原propsintact
上添加render 函数 内部返回一个空白标签 , 设置ref
以备后用intact
组件实例,添加react 响应的生命周期方法 , 在props 更新后选择重新实例化intact
组件 , 挂载在真实dom ,或者更新intact
组件intact
组件是转换传入的props
为intact
格式,同时转换children, 把react
通过props 传入的children为react
的实例 再次转换为intact
实例 , 设置模拟proxy函数代理setState等react 方法 实质调用intact 更新resolve: {
alias: {
'intact$': 'intact-react'
}
}
import Intact from 'intact';
import React from 'react'
import ReactDOM from 'react-dom'
const h = React.createElement;
class I extends Intact {
@Intact.template()
static template = `<div ev-click={self.onClick}>{self.get("children")} child default content {self.get("count")}!</div>`
onClick(e) {
const count = this.get('count');
this.set('count', count + 1);
}
defaults() {
return {
count: 1
};
}
}
class R extends React.Component {
constructor(props) {
super(props);
this.state = {
count: 1
};
}
componentDidMount() {
console.log(this, 'react componentDidMount')
}
click() {
this.setState({
count: this.state.count + 1
})
}
render() {
return h('div', {
id: 'react',
onClick: this.click.bind(this)
}, ['wrap', h(I,{},'this is intact children'), `${this.state.count}`])
}
}
const container = document.createElement('div');
document.body.appendChild(container);
const component = h(R,{});
ReactDOM.render(
component,
container
);
intact 内部 的react 组件render 只支持返回一个节点 , 多节点将会报错
react 添加 slot 支持 , children 的 props 属性上添加slot
将对应 intact 内部的<b:block></b:block>
, 详细可参见test 目录下的测试用例
FAQs
A compatibility layer for running intact component in React@17
The npm package intact-react receives a total of 13 weekly downloads. As such, intact-react popularity was classified as not popular.
We found that intact-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.