Answer the question
In order to leave comments, you need to log in
redux form. How to get formValueSelector of form when form name is passed in props?
Here - redux-form.com/6.5.0/examples/selectingFormValues there is an example on working with formValueSelector, it works great. As you can see, the form name in the example is specified explicitly
const selector = formValueSelector('selectingFormValues') // <-- same as form name
let MyForm = (props) => {
return(
<Form form={props.form || 'default_name'}>
..........
</Form>
)
}
MyForm = reduxForm({
fields:[.........],
validate
})(MyForm)
const selector = formValueSelector(??) // Как мне достать идентификатор формы?
.................
Answer the question
In order to leave comments, you need to log in
It is not clear from the example what prevents us from passing the 'selectingFormValues' string instead of a variable containing the name of the form?
For example, in a switch case statement, depending on props, set the required value to a variable and pass it to formValueSelector(my_variable)
How to adapt? the designer must determine how the elements on the screen will change depending on its width and length, and the programmer must implement this. Of course, the designer can consult with the programmer which options are better (easier) to use. If there is not enough space for text, for example, the font can be reduced, or you can add or increase an object by scrolling by reducing the indents and (or) neighboring objects. Dependencies are implemented using the AutoLayout mechanism, but the programmer should already know this.
Pictures, if these are icons, then usually .pdf (Xcode itself renders png24 of them at compile time, or jpeg (png) if it is a photo. svg is not used in iOS.
in terms of adaptation, I more or less understood.
I adjust the text and images for different resolutions, I figured it out in principle.
The question is different. How exactly should the elements be exported?
That is, I have a button, a block. Am I exporting a button without text? And the programmer looks at the layout and understands how the text is located there and what characteristics it has?
And in the same way absolutely elements? That is, we must disassemble the design completely, into buttons, backgrounds, icons, etc.?
And why does the same xd adobe export files to x1 x2 x3 If in fact I am currently designing only for iphone x? Or these elements - the same x2, can be typeset immediately on the iphone - 6, 7, 8?
In general, there are many incomprehensible moments.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question