Issue
By rendering the FlatList I always get the error "Objects are not valid as a React child (found: object with keys {dispatchConfig, _targetInst, _dispatchListeners, _dispatchInstances, nativeEvent, type, target, currentTarget, eventPhase, bubbles, cancelable, timeStamp, defaultPrevented, isTrusted, isDefaultPrevented, isPropagationStopped}). If you meant to render a collection of children, use an array instead.".
I find out that the rendered item in the Text component needs to be a primitive type but I think it's rendering a string which is a primitive type.
Solution
The problem is that you are passing objects rather than strings into the courseGoals
array. This is because the onChange
handler of TextInput takes a whole event object.
Switch it to onChangeText
, which passes a string, and it should work.
Answered By - Kai
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.