react-native

Sharing code between React Native + Node

我的未来我决定 提交于 2021-02-19 02:27:12
问题 I am using React Native and Node.js. I want to share code between the two. My folder structure is as so. myreactnativeapp/ mynodeserver/ myshared/ In the react native and node apps I have included the package.json "dpendencies" : { "myshared": "git+https://myrepository/ugoshared.git" } This can then be included in each project via require/import etc. This all works fine and for production I'm happy with it. (Though I'd love to know a better way?) The issue I'm facing is in development it's

react-native-image-picker vs expo ImagePicker

ⅰ亾dé卋堺 提交于 2021-02-18 22:09:31
问题 I have tried many attempts to get react-native-image-picker up and working with my RN app. I am using Expo and VS Code and am not running the app with Xcode or Android Studio. There seems to be many options to getting the camera roll available in an app and I am not sure which is the best path to take. None seem to be working for me so I would like to pick the best path and focus on making that one route work. I am following the documentation: https://github.com/react-native-community/react

react-native-image-picker vs expo ImagePicker

[亡魂溺海] 提交于 2021-02-18 22:06:03
问题 I have tried many attempts to get react-native-image-picker up and working with my RN app. I am using Expo and VS Code and am not running the app with Xcode or Android Studio. There seems to be many options to getting the camera roll available in an app and I am not sure which is the best path to take. None seem to be working for me so I would like to pick the best path and focus on making that one route work. I am following the documentation: https://github.com/react-native-community/react

react-native-image-picker vs expo ImagePicker

青春壹個敷衍的年華 提交于 2021-02-18 22:05:23
问题 I have tried many attempts to get react-native-image-picker up and working with my RN app. I am using Expo and VS Code and am not running the app with Xcode or Android Studio. There seems to be many options to getting the camera roll available in an app and I am not sure which is the best path to take. None seem to be working for me so I would like to pick the best path and focus on making that one route work. I am following the documentation: https://github.com/react-native-community/react

How to get the correct screen width in react-native iOS?

蓝咒 提交于 2021-02-18 21:11:45
问题 react-native Dimensions.get("window").width return 375 for an iPhone 6s.... it seems far from correct. ` import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, Dimensions } from 'react-native'; class AwesomeProject extends Component { render() { return <Text style={{margin:50}}>Width: {Dimensions.get("window").width}</Text>; } } AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);` 回答1: 375 is the number of points across for the iPhone 6. For

React Native - how to make a border image?

与世无争的帅哥 提交于 2021-02-18 20:19:54
问题 I want to make a border image to a View , similar to border-image in the css. How could I achieve it ? 回答1: I believe that if you use Styled Components (https://www.styled-components.com/) you can set it with CSS directly. It will be something like this: import styled from 'styled-components/native'; const StyledView = styled.View` border-image: <your definition here>; `; And then simply use it like you always do: <StyledView> </StyledView> Hope it helps! 回答2: You can use ImageBackground

React Native - how to make a border image?

这一生的挚爱 提交于 2021-02-18 20:17:48
问题 I want to make a border image to a View , similar to border-image in the css. How could I achieve it ? 回答1: I believe that if you use Styled Components (https://www.styled-components.com/) you can set it with CSS directly. It will be something like this: import styled from 'styled-components/native'; const StyledView = styled.View` border-image: <your definition here>; `; And then simply use it like you always do: <StyledView> </StyledView> Hope it helps! 回答2: You can use ImageBackground

React Native - how to make a border image?

本小妞迷上赌 提交于 2021-02-18 20:17:31
问题 I want to make a border image to a View , similar to border-image in the css. How could I achieve it ? 回答1: I believe that if you use Styled Components (https://www.styled-components.com/) you can set it with CSS directly. It will be something like this: import styled from 'styled-components/native'; const StyledView = styled.View` border-image: <your definition here>; `; And then simply use it like you always do: <StyledView> </StyledView> Hope it helps! 回答2: You can use ImageBackground

React Native - how to make a border image?

99封情书 提交于 2021-02-18 20:16:11
问题 I want to make a border image to a View , similar to border-image in the css. How could I achieve it ? 回答1: I believe that if you use Styled Components (https://www.styled-components.com/) you can set it with CSS directly. It will be something like this: import styled from 'styled-components/native'; const StyledView = styled.View` border-image: <your definition here>; `; And then simply use it like you always do: <StyledView> </StyledView> Hope it helps! 回答2: You can use ImageBackground

React-Navigation: Use/Change header title with Redux state

女生的网名这么多〃 提交于 2021-02-18 20:11:29
问题 Is it possible to access the whole Redux state inside the React Navigation's header title? The official docs says that the state corresponding to the navigation is accessible: static navigationOptions = { title: ({ state }) => `Chat with ${state.params.user}` }; But I wish to access other parts of my Redux state, with the title updating when that state updates. Is that possible today? 回答1: this is possible with a little workaround. I would not even call this a workaround either I would call