Giter Club home page Giter Club logo

Comments (3)

AbigailMcP avatar AbigailMcP commented on June 10, 2024 1

Glad you got it working accessing the onValuesChange prop!

Re your second question, there are two types of components you need to wrap in order to test it's props:

  1. A function component (as explained in the docs)
  2. Some of React Native's basic components like <Text> and <TextInput>. This is unfortunately due to React Native restructuring some of it's core components (this blog post explains it well). In short, when you add a ref to these components, React Native are now forwarding it so that a Native component is returned and not the React Native component itself. This means that the JS props are not for Cavy to call from within tests.

The current solution is to wrap these components so that Cavy can obtain a reference to these props. It's not ideal, but we're working on a solution at the moment that means you don't have to do this :)

from cavy.

Marzdor avatar Marzdor commented on June 10, 2024

Realized I had a typo for my failed test onValuesChange and not onChange.

Also realized that I don't need to wrap the slider to access onValuesChange.

But, now I am wondering why it is necessary to wrap react-native components. I see this note in the documentation (which is neither a React Class nor a Function Component) but am trying to better understand how they are not a React Class.

For example <View> in the definition extends ViewBase which is a typeof ViewComponent that extends React.Component<ViewProps>

from cavy.

AbigailMcP avatar AbigailMcP commented on June 10, 2024

Closing for now as I don't think there was an issue, but feel free to ask questions on here / continue the discussion.

from cavy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.