Skip to content
New issue

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

Warning: Each child in a list should have a unique "key" prop. #165

Closed
Quantmatic opened this issue Dec 21, 2020 · 1 comment · Fixed by #167
Closed

Warning: Each child in a list should have a unique "key" prop. #165

Quantmatic opened this issue Dec 21, 2020 · 1 comment · Fixed by #167

Comments

@Quantmatic
Copy link

Setup (always fill this in):

Describe the bug
Following the guide you got here:

Get a keyProp error dump

Warning: Each child in a list should have a unique "key" prop.

Check the top-level render call using <Text>. See https://fb.me/react-warning-keys for more information.
    in Text
    in Unknown (created by Activity)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at TouchableOpacity.js:223)
    in TouchableOpacity (at TouchableOpacity.js:301)
    in ForwardRef (created by Activity)
    in Activity (at App.tsx:15)

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://github.com/Quantmatic/getstream_feed.git'
  2. git clone https://github.com/Quantmatic/getstream_feed.git
  3. yarn install
  4. yarn start
  5. expo open ios emulator

Expected behavior
No key prop error
The props that are passed to the components should have a unique key prop

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context

const CustomActivity = (props) => {
  return (
    <Activity
      {...props}
      Footer={
        <LikeButton {...props} />
      }
    />
  );
};
@Quantmatic
Copy link
Author

Quantmatic commented Dec 23, 2020

The solution is adding the key: i, to the react-native-activity-feed-core Activity.js component line 164 inside the node_modules

@vishalnarkhede vishalnarkhede linked a pull request Jan 7, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant