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

Basic example doesn't actually return anything #231

Closed
Fmstrat opened this issue Aug 1, 2022 · 6 comments
Closed

Basic example doesn't actually return anything #231

Fmstrat opened this issue Aug 1, 2022 · 6 comments
Assignees
Labels
documentation Improvements or additions to documentation needs review The issue has been solved, Wait for confirmation.

Comments

@Fmstrat
Copy link

Fmstrat commented Aug 1, 2022

I'm trying to understand how to use this without Typescript, and the most basic example from the README doesn't actually work. For example, you can see in the link that this shows a blank screen:

import Carousel from "react-native-reanimated-carousel";
import { Text, View } from "react-native";

export default function App() {
  return (
    <View style={{ flex: 1 }}>
      <Carousel
        width={300}
        height={150}
        data={[1, 2, 3]}
        renderItem={({ item }) => (
          <View>
            <Text>Test - {item}</Text>
          </View>
        )}
      />
    </View>
  );
}

https://codesandbox.io/s/quirky-meadow-e5z4wx?file=/src/App.js

How does one proceed?

@Fmstrat Fmstrat added the documentation Improvements or additions to documentation label Aug 1, 2022
@Fatjookie
Copy link

Fatjookie commented Aug 6, 2022

Same here with Expo. The library looks absolutely amazing and it is sad I cannot get it to work.
After a bunch of reinstalling (mainly, Reanimated). I ended up with:

text strings must be rendered within a text component

item were rendered within a <Text>{ item }</Text> component. I tried modiying everything for several hours yesterday, but couldn't make it work.

Take your time @dohooo and I do not expect anything else, than you keep doing that wonderful work of god you're currently doing.

EDIT:
Found the response with the trailing semi-colon at the end. Everything works now.

@CaptainEboy
Copy link

@Fatjookie how were you able to implement this in js.

@aprct
Copy link

aprct commented Aug 7, 2022

It could be that things are just rendering way off screen.

I was rendering something about 400 units in height, but to vertically center the carousel I had to set the <Carousel>'s height prop to -200 after setting the Carousel's sizing and positioning to take up the whole screen. If I set the height prop to 400, then it just rendered really far above the screen.

I'm not entirely sure that I understand the height prop correctly, so I can't speak to whether this is a bug or if it's working as intended.

@dohooo dohooo added the P1 label Aug 11, 2022
@dohooo
Copy link
Owner

dohooo commented Aug 12, 2022

Same here with Expo. The library looks absolutely amazing and it is sad I cannot get it to work. After a bunch of reinstalling (mainly, Reanimated). I ended up with:

text strings must be rendered within a text component

item were rendered within a <Text>{ item }</Text> component. I tried modiying everything for several hours yesterday, but couldn't make it work.

Take your time @dohooo and I do not expect anything else, than you keep doing that wonderful work of god you're currently doing.

EDIT: Found the response with the trailing semi-colon at the end. Everything works now.

Sorry for that, my problem. #226 (comment)

@dohooo
Copy link
Owner

dohooo commented Aug 12, 2022

@Fmstrat I haven't tried using RNRC on projects that aren't EXPO hosting, so is it possible that it's your configuration problem? And it is normal for me to use RNRC in JS RN project.

image

image

image

@dohooo dohooo added needs review The issue has been solved, Wait for confirmation. and removed P1 labels Aug 12, 2022
@dohooo
Copy link
Owner

dohooo commented Aug 18, 2022

I'll reopen this issue If you have any other questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation needs review The issue has been solved, Wait for confirmation.
Projects
None yet
Development

No branches or pull requests

5 participants