Comments (9)
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.
Hello there!
Are there any updates on this issue?
from react-final-form.
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.
Hmm, maybe:
interface IFieldProps {
bla: bla;
[x: string]: any ;
}
But I'm wondering if this is a good practice
from react-final-form.
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.
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.
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.
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.
Published fix in v6.3.4
.
from react-final-form.
Related Issues (20)
- Error messages on nested object values HOT 1
- Form Reset When Modal Close HOT 1
- Field State Sync Issue in Strict vs Non-Strict Mode in react-18 HOT 5
- Q: should readonly fields be validated on blur?
- Error in codesandbox example HOT 2
- Documentation for defaultValue of FieldProps is not matching implementation
- Warning message in console when using the field validation for a string field. HOT 3
- Ran into "is dirty" validation issues when state was used to autofill a form's input field. HOT 1
- [Feature Request] Add new prop to specify changes to specific form fields HOT 1
- change is not a function HOT 1
- Rewrite To Typescript HOT 2
- rerenderOnEveryChange for react-final-form
- <FormSpy> components rendering earlier than in previous versions
- DestroyOnUnregister incompatible with StrictMode in React18 HOT 2
- isEqual is initialized by the first field registered instance
- useField does not rerender component, when its props change
- Submitting Images in React Final Form
- I believe defaultValue should be the DEFAULT. That means, if NO initialValue was passed in, the defaultValue would be used. If there is an initialValue, it should override the defaultValue. One work around is using an OR in initialValues and skip using defaultValue all together like so:
- Form not dirty after removing items from FieldArray using final-form-arrays
- Field-Level validation for root and nested fields
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-final-form.