The value on the Context Provider doesn't change
So, I'm learning about React Context and try to implement it by creating an auth state for my React Native app. I tried following this Ben Awad's repo. This is what I've got so far://...
View ArticleCould not be found within the project
Im struggling here.I could not install a NPM registry properly from Github so I decided to install the files manually.I created a folder called /libs and I copied across the files and changed all the...
View ArticleChange text input color for hashtags react native mobx
I want to dynamically change the color of words in a textInput element where a hashtag comes up. Similar to a lot of apps. Here is what i have so far:@observable descriptionString: any = '';@observable...
View ArticleHow to change all colors inside the Card
At the layout when the status is Fechado I need to change the Card and all data inside to a gray color.Remembering that the Title, Description, Separator, Classification, MinimumValue and Profitability...
View ArticleuseRef.current is undefined in a React Native functional component
I'm trying to focus a text input field once the user clicks a button. The code looks as follows:const refName = React.useRef();const changeFocus = () => { refName.current.focus();}with the text...
View ArticleReact Native (or React) listen to the style changes for the dark mode in...
Goal: Implement dark mode in react native application.A little introduction to the system:File structure:Profile.tsProfileCss.tsconstants.tsIn my application in order to separate styles from...
View ArticleReact-Native create button when other button's onPress Event
I want the button to be dynamically created and used when the onPress event occurs. Ask for help from great and kind friends.I want{ in screen one Button , -> Button click -> create one Button...
View ArticleButton to reload the screen when the WiFi is off
I have a screen that I verify if the WiFi is connected. If the WiFi is off I show in the screen a message and a button Try Again but I would like to click in this button and refresh the...
View ArticleThe property favorited does not exists at the object
I am calling the third-party API and the data does not have the favorited property, then I added the property favorited at the interface StocksProps:Interface StocksPropsinterface StocksProps { id:...
View ArticleAdding type for useRef on ScrollView react-native
Looking to create a ref to a ScrollView component like so: const ref = useRef<ScrollView>(null); (or something to this effect) essentially I need access to the flashScrollIndicators method like...
View ArticleHow do i rerender my screen after deletion from list?
Hello I've been looking through several threads on stackoverflow but I haven't been able to solve my problem. I have an app where you can save movies to a watchlist. On this specific screen I want to...
View ArticleDefault Values with Interface in Arrow Function (TypeScript, React)
This question is specific to arrow functions. Is it possible to include the default values alongside an interface in the function parameters, and without resorting to Object.assign()?interface Props {...
View ArticleTypescript access object key dynamically
I have Theme.ts file like belowexport default { COLORS: { DEFAULT: '#172B4D', PRIMARY: '#5E72E4', SECONDARY: '#F7FAFC', }};In my button component I import above theme file like this --> import...
View ArticleReact Natice Expo: How can I change 「BottomTab.Screen」name type alias to...
BackgroundI try first time React Native Expo with typescript.so, I have no idea to use BottomTab.Screen.Q. I would like to change 「name="TabOne"」to Japanese is 「ホーム」.//...
View ArticleConst variable as type - Typescript
During learning Typescript I faced problem when I used constant variable with the value of action which I use to reducer (created to prevent typo - I have read somewhere it is good practice).const...
View ArticleReact Native useRef with custom TextInput and TypeScript
I am getting the following warning on my custom input component:'TextInput' refers to a value, but is being used as a type here. Did you mean 'typeof TextInput'?When referencing it using useRef like...
View ArticleConverting Class based js component to typescript component with dynamic...
I have a class based component like thisclass ArInput extends React.Component { render() { const { shadowless, success, error } = this.props; const inputStyles = [ styles.input, !shadowless &&...
View ArticleJavascript: Unexpected token { - occurs when try to import custom class in...
I am writing simple CLI scripts for react-native project. But I am not available to import class from typescript to javascript. It throw me following error.import { TestResult } from...
View ArticleHow to pass all props to styled component in React Native with TypeScript?
I have a styled component:const Wrapper = styled.View` align-items: center; flex-direction: row;`;I have a component which is using this styled component:interface ProfileInfoBar extends ViewProps...
View ArticleGet internet speed in React using image download
I am trying to calculate the internet speed but I get a small value. This is the code:useEffect(() => var imageAddr = "../../img/noventi-logo.png" +"?n=" + Math.random(); var startTime: number,...
View Article