Questions tagged [unstated]

22 questions
0
votes
1 answer

Cursor jumps to end when input value comes from "unstated" provider

I have currently facing a problem with provider (from unstated lib) and input. In our project, we have to share inputs values between several components, so we have created a provider (with unstated lib) that contains the values. The values are…
TronchDeYack
  • 33
  • 13
0
votes
1 answer

React this.props.children.apply is not a function

I'm making a react app with unstated to manage the state of my app, the application is a simple CRUD of notes. I have a NoteList component to render the list of Notes. This is my render() function in NoteList Component: render() { return ( …
Rohr Facu
  • 607
  • 1
  • 12
  • 29
0
votes
2 answers

Conditionals in Unstated (React)

I'm learning to implement Unstated in my react app. I made a simple app that shows a Note using Unstated. This is my NoteContainer: class NoteContainer extends Container { state = { title: 'My Note', desc: 'This note state is…
Rohr Facu
  • 607
  • 1
  • 12
  • 29
0
votes
1 answer

Integrating React Router with Unstated

The following code, where each component includes causes ZebraContainer to be constructed three times. Is there an accepted pattern to maintain ZebraContainer as a global singleton and only construct once? …
Michael Pell
  • 1,416
  • 1
  • 14
  • 17
0
votes
1 answer

Unstated Cannot read property 'setState' of undefined

I'm using a state library called unstated and when I run the following code: import { Container } from 'unstated'; import Fire from '../Core/Fire'; class Store extends Container { state = { users: [], }; getAllUsers() { const db =…
user818700
0
votes
1 answer

Issue with Unstated and React Navigation in React Native

I have the function onPress = (store) => { //store.flipState(); this.props.navigation.navigate('anotherScreen'); console.log('hi'); } If I run it as above the navigation works. If I uncomment the store.flipState() line the state changes but the…
-1
votes
1 answer

Unexpected token, expected "..."

I got the error: Unexpected token, expected "..." I use react unstated. My code: return ( {chatProvider => ( <> Hello World ) }
Jak2k
  • 57
  • 1
  • 7
1
2