Giter Club home page Giter Club logo

Comments (9)

rafaelcorreiapoli avatar rafaelcorreiapoli commented on May 11, 2024 5

styled-components is a library compatible with both react and react-native (and it has completely different implementations for each one). The way it's API works is by exposing functions from styled-components/native. So if you are targeting web you import from styled-components and if you are targeting react-native, you import from styled-components/native.
Maybe we could expose a different component (under react-form-react/native) for react-native usage

from react-final-form.

sergei-zelinsky avatar sergei-zelinsky commented on May 11, 2024 2

Hello there!

Are there any updates on this issue?

from react-final-form.

erikras avatar erikras commented on May 11, 2024

I think #84 handled the first one, right @cosmith?

Is there a way to say, "This stuff, and anything else" in type definitions?

from react-final-form.

rafaelcorreiapoli avatar rafaelcorreiapoli commented on May 11, 2024

Hmm, maybe:

interface IFieldProps {
     bla: bla;
    [x: string]: any ;
}

But I'm wondering if this is a good practice

from react-final-form.

erikras avatar erikras commented on May 11, 2024

I'm largely ignorant of TS, so don't feel like I can make a judgement call on this. First check other React component libs, and if it seems like something people do, I'd be happy to accept a PR with this change.

from react-final-form.

geowarin avatar geowarin commented on May 11, 2024

Extra props is a duplicate of #79, it's fixed on master already.

@rafaelcorreiapoli I've never used react-native but looking a the definitions, NativeSyntheticEvent does not extend SyntheticEvent, hence the problem that you describe.

Surely other libraries (compatible with both react and react-native) encountered this problem already. Do you know of any good example we can take inspiration from?

from react-final-form.

geowarin avatar geowarin commented on May 11, 2024

Is it a good practice, idk but this pattern is used all over the place.

It is a way of saying "here are the props the lib cares about, you can pass anything else but we won't use it". As long as we maintain the "official" attribute list, we're OK.

from react-final-form.

bezenson avatar bezenson commented on May 11, 2024

One more issue with React native. onPress and handleSubmit

       <Form
          render={({ handleSubmit }): JSX.Element => (
              <TouchableOpacity onPress={handleSubmit}>
                Submit
              </TouchableOpacity>
          )}
        />

Type '(event?: SyntheticEvent<HTMLFormElement, Event> | undefined) => Promise<AnyObject | undefined> | undefined' is not assignable to type '(event: GestureResponderEvent) => void'.

from react-final-form.

erikras avatar erikras commented on May 11, 2024

Published fix in v6.3.4.

from react-final-form.

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.