使用帮助方法getLayout()时抛出错误

时间:2017-11-10 02:43:17

标签: react-native

我不确定代码有什么问题。我正在使用辅助方法while IFS=$'\(\)+,' read -ra line; do for i in 1 3 5; do case "${line[$i]}" in x) printf "%s\t%s\t%s\t" 1 0 0 ;; y) printf "%s\t%s\t%s\t" 0 1 0 ;; z) printf "%s\t%s\t%s\t" 0 0 1 ;; -x) printf "%s\t%s\t%s\t" -1 0 0 ;; -y) printf "%s\t%s\t%s\t" 0 -1 0 ;; -z) printf "%s\t%s\t%s\t" 0 0 -1 ;; esac done for i in 2 4 6; do printf "%s\t" "${line[$i]}" done echo done < "$filename" 来获取动画元素的位置。默认情况下,根据此文档http://browniefed.com/react-native-animation-book/api/GETLAYOUT.html.,它应存在于getLayout()中。

非常感谢一些帮助和解释。

ValueXY

1 个答案:

答案 0 :(得分:0)

只是一个错字 - conponentWillMount - &gt; componentWillMount。这阻止了您的初始化,并且意味着this.position未定义,导致访问this.position.getLayout时出错。