gaoryrt
gaoryrt
Just do it.
I think this will work: https://codesandbox.io/s/snowy-tdd-gf9hp?file=/src/App.js:89-488 ```jsx const FlipNumber = ({ number: realNumber }) => { const ref = useRef(); const flipRef = useRef(null); useEffect(() => { flipRef.current = new...
thank you for your suggestion, but i am afraid that i cannot do that by myself because of my poor wechat mini app dev-experience.
so you saying https://github.com/gaoryrt/number-flip/blob/master/number-flip.js
I don't know if this problem could be solved by renaming the `Flip` property and build one for own usage? @yadigithub
@evinma Got a branch for this: https://github.com/gaoryrt/number-flip/tree/maxLenNum But never thought making it a property 🤔🤔🤔
在中后台业务中归纳出这样的方法,将组件 promise 化: ```jsx function promisify(Render) { return new Promise((res, rej) => { const div = document.createElement('div') document.body.appendChild(div) ReactDOM.render( { if (val) res(val) else rej() ReactDOM.unmountComponentAtNode(div) document.body.removeChild(div) }} />, div...
> 这个方法很赞!我们也有类似的工具函数,对于 99% 场景都足够了(也没遇到无法支撑的场景),主要是去年看到了 NiceModal,调用方式更加灵活,也解决了 Context 问题,就换 NiceModal 了。 以前的我:这样写是不是违反了 React 伦理,会不会坏了祖师爷立下的规矩 现在的我:去 tm 的 Thinking in React
@enclairfarron indeed
好像是微信灰度发布的一个限制,v2ex 有讨论:https://www.v2ex.com/t/391393