Questions tagged [recompose]

Recompose is a React utility belt for function components and higher-order components. Think of it like lodash for React.

Recompose is a React utility belt for function components and higher-order components. Think of it like lodash for React.

You can use Recompose to

  • lift state into functional wrappers
  • perform the most common React patterns
  • optimize rendering performance
  • interoperate with other libraries
  • build your own libraries

Useful Links

Related tags

192 questions
1
vote
1 answer

Retrieve recompose local dispatch function from withReducer in withHandlers

I have a component which is already connected to the redux store and has the dispatch injected to it. I am trying to update the local state of the component using withReducer and withHandlers like this: const reducer = (state, action) => { switch…
vamsiampolu
  • 6,328
  • 19
  • 82
  • 183
1
vote
1 answer

React HOC with 'recompose' and 'redux-cycles'. How to make it work?

So, I've been playing around with recompose and then, I've discovered this redux-cycles, which I think it's great for what I'm aiming: functional JS and reactiveness. The problem is that I can't make the event listener work when I create the…
KadoBOT
  • 2,944
  • 4
  • 16
  • 34
1
vote
1 answer

Apollo GraphQL mutations with recompose

I recently came across with this “Simplify your React components with Apollo and Recompose” @stubailo https://dev-blog.apollodata.com/simplify-your-react-components-with-apollo-and-recompose-8b9e302dea51 It shows how you can do GraphQL queries with…
1
vote
2 answers

How to test a react component properly?

I'm not an expert about unit testing, and i'm trying to achieve 100% coverage on my dummy todoapp project, its easy for simple components like a TodoList component, but what about the AddTodo component? import React, {PropTypes} from 'react' import…
cl0udw4lk3r
  • 2,663
  • 5
  • 26
  • 46
0
votes
3 answers

Composable Keeps recomposing - Loading Dialog Keeps Updating Multiple Times

VisionBoardNameViewModel I'm experiencing an issue where a ProgressDialog that displays loading information is persistently shown due to frequent recomposition of our Composable UI. This behavior is likely caused by how I manage and update data in…
Pratik Fagadiya
  • 1,195
  • 7
  • 21
0
votes
2 answers

Remember, not to work as well and restart

Recently I faced a problem with remember in compose; I have two simple, composable functions like the below: @Composable fun foo() { var x = remember { 1 } x += 1 Text("$x") } @Composable private fun MainScreen() { var state by…
hamid Mahmoodi
  • 690
  • 4
  • 16
0
votes
1 answer

collectAsState performance when we use By or =

What different performance when uiState init with collectAsState and use by or = ? val uiState by viewModel.uiState.collectAsState() vs val uiState = viewModel.uiState.collectAsState()
0
votes
0 answers

Jetpack Compose Recomposition Flow Room Database SQL

I have a problem with Lazycolumn refreshing if data in sql database changes. The list is on flow and refresh works if i start searching. But I don't know how to call the change of the list again after clicking the button that saves new data to the…
Krystian
  • 3
  • 1
0
votes
0 answers

Jetpack Compose, Multiple recomposition of the view when updating progressbar

I new to Jetpack compose and i'am creating a view to download a file from my api, i have a call back to give me the % or the download and i would like it display it on a progress bar. The problem is that everytime i update the progressbar, it seems…
0
votes
0 answers

Context value not updated inside Recompose withHandlers

I have context withActiveModalData and it has activeID export const withActiveModalData = (Component: React.ComponentType) => React.forwardRef((props, ref) => ( {({ activeId, closeModal, data, promptData,…
Jasurbek Nabijonov
  • 1,607
  • 3
  • 24
  • 37
0
votes
0 answers

Recompose branch to render on top of wrapped component

If i have something like compose( withData() branch(props => props.isLoading, renderComponent(()=>)) )(DataList) what will happen is that the Spinner component will replace DataList in the DOM while loading. How can i have the…
Bolza
  • 1,904
  • 2
  • 17
  • 42
0
votes
1 answer

How to pass html element as child in Angular Higher Order Components (HOC)?

I want to pass an HTML element in my Angular Higher Order Component. Right now I'm passing child element as a @Input decorator. My HOC, Main Container is like this.
0
votes
0 answers

How do I recompose TCP-Datastream although the TCP-Synchronization packages create new sequence numbers by chance?

I'm working with python scapy and I had to extract voice data from a file with a U-LIC header. It went fine. I took the payload in which there is IP, TCP and RTP. I've extracted the TCP-Packets successfully and I've ordered them by TCP.sequence,…
Uwe_98
  • 697
  • 1
  • 8
  • 21
0
votes
1 answer

TS error: "Cannot find name 'T' how to pass the generic?

I am using https://www.npmjs.com/package/recompose in my project I need to pass a generic "T" to Table, how to change the type signature so compose, CompProps> will be satisfied? I have tried with no success: export const Table =…
Radex
  • 7,815
  • 23
  • 54
  • 86
0
votes
1 answer

Maximum update depth exceeded with recompose

i saw several topics talking about this common mistake, but i didn't find nothing related to the use of recompose. Context I've this withStateHandler withStateHandlers( { bookingValidation: false, }, { setBookingValidation:…
Legeo
  • 784
  • 4
  • 20
  • 44