'How to create dynamic stats for dynamic range sliders in react native?
I am creating multiple range sliders using map (means dynamic) I wants to set range values(min & max) for every range slider. how to do that ? Please check my code..
//RANGE SLIDER
{
[...Array(fields.field_count)].map((item, index) => {
return (
<View style={{ alignItems: 'center' }}>
<Controller
control={control}
name={fields.field_name[index]}
defaultValue=""
key={fields.field_name[index]}
render={({ field: { onChange, onBlur, value } }) => (
<View>
<RangeSlider
min={fields.min[0]}
max={fields.max[0]}
step={0.1}
floatingLabel={true}
allowLabelOverflow={true}
renderThumb={renderThumb}
renderRail={renderRail}
renderRailSelected={renderRailSelected}
renderLabel={renderLabel}
renderNotch={renderNotch}
onValueChanged={handleValueChange}
/>
<View style={{ flexDirection: "row", width: 300, top: 5, }}>
<Text style={styles.silderText}>{low} mm</Text>
<View>
<Text style={[styles.silderText,{right:15 }]}>{high} mm</Text>
</View>
</View>
</View>
)}
/>
</View>
);
})
}
// Value Handler
const handleValueChange = useCallback((low, high) => {
setLow(low);
setHigh(high);
}, []);
Solution 1:[1]
{
[...Array(fields.field_count)].map((item, index) => {
return (
<View style={{ alignItems: 'center' }}>
<Controller
control={control}
name={fields.field_name[index]}
defaultValue=""
key={fields.field_name[index]}
render={({ field: { onChange, onBlur, value } }) => (
<View>
<RangeSlider
min={fields.min[0]}
max={fields.max[0]}
step={0.1}
floatingLabel={true}
allowLabelOverflow={true}
renderThumb={renderThumb}
renderRail={renderRail}
renderRailSelected={renderRailSelected}
renderLabel={renderLabel}
renderNotch={renderNotch}
onValueChanged={handleValueChange}
/>
<View style={{ flexDirection: "row", width: 300, top: 5, }}>
<Text style={styles.silderText}>{low} mm</Text>
<View>
<Text style={[styles.silderText,{right:15 }]}>{high} mm</Text>
</View>
</View>
</View>
)}
/>
</View>
);
})
}
Solution 2:[2]
In spring boot you can specify your custom config for liquibase:
spring:
liquibase:
change-log: classpath*:db/changelog/db-changelog.xml
password: ${DB_PASSWORD:postgres}
url: jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:postgresql}
user: ${DB_USER:postgres}
So it could be completely different from one you use for spring datasource.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Lee Taylor |
| Solution 2 | bilak |

