기본 콘텐츠로 건너뛰기

9월, 2017의 게시물 표시

React parent component에서 child component에 method 호출하는 방법

꼭 아래 script를 html script로 추가해야 작동합니다. https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react-dom.js https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react-with-addons.js class Child extends React.Component { componentDidMount() { this.props.onRef(this) } componentWillUnmount() { this.props.onRef(null) } method() { alert('do stuff') } render() { return Hello World! } } // Any higher-order component (HOC), for examle: // withStyles https://github.com/kriasoft/isomorphic-style-loader // connect https://github.com/reactjs/react-redux // etc. class EnhancedChild extends React.Component { render() { return } } class Parent extends React.Component { onClick = () => { this.child.method() // do stuff }; render() { return ( (this.child = ref)} /> Child.method() ); } } ReactDOM.render( , document.getElementById('root'))  

Xamarin forms error solution

Problem : MTOUCH: error MT0091: This version of Xamarin.iOS requires the iOS 10.3 SDK (shipped with Xcode 8.3 ) when the managed linker is disabled. Either upgrade Xcode, or enable the managed linker. Solution :  Xamarin Stable with iOS 10.3 SDK / Xcode 8.3 Problem : debugging.targets(516,2): error : FastDev Directory Creation Failed Solution :  Android: Deployment failed. FastDev directory creation failed