We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import React, { useEffect } from "react"; import { RouteComponentProps } from "react-router"; import useCounterModal from "~/models/global"; import styles from './index.less'; export default (props: RouteComponentProps & { children: React.ReactNode }) => { const { children } = props; console.log(props); const { count,increment, decrement } = useCounterModal(); // useEffect(() => { // console.log(count); // }, [count]) return ( <div className={styles.main_layout}> <div>我是layout啊</div> {children} {/* {count} <div onClick={increment}>按我+1</div> <div onClick={decrement}>点我-1</div> */} </div> ); };
modal--
import { createModel } from 'hox'; import { useState } from 'react'; const useCounter = (initCount?: number) => { const [count, setCount] = useState(initCount || 0); const decrement = () => setCount(count - 1); const increment = () => setCount(count + 1); return { count, decrement, increment }; }; const useCounterModal = createModel(useCounter, 10); export default useCounterModal;
开发时候直接加载不动了,一直在转圈,把useCounterModal 那块注释掉就好了 hox: 1.1.14 react:16.13.1 webpack 配置了 externals
externals: { 'react': 'React', 'react-dom': 'ReactDOM', },
浏览器debugger 后发现 一直会进入handleError, 无限循环 发现res 没有打印了,reconciler.updateContainer(reactElement, container, null, null); 这一行内一直在执行中,貌似是react-reconciler 引起的问题
The text was updated successfully, but these errors were encountered:
我也是。暂时 1,把external - react 去掉。 2,把src 指向 npm里的umd。
2选1,dev和prd都能测通。
但如果本地指向bootcdn的umd production确实就会卡。看了官方目前recoiler暂时也是experiment,不知道和他的自定义容器有没有关系。
Sorry, something went wrong.
No branches or pull requests
modal--
开发时候直接加载不动了,一直在转圈,把useCounterModal 那块注释掉就好了
hox: 1.1.14 react:16.13.1
webpack 配置了 externals
浏览器debugger 后发现 一直会进入handleError, 无限循环
发现res 没有打印了,reconciler.updateContainer(reactElement, container, null, null); 这一行内一直在执行中,貌似是react-reconciler 引起的问题
The text was updated successfully, but these errors were encountered: