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
0
votes
0 answers

recompose withstate HOC added a header on a tabNavigator screen (expo snack)

I recently added a withState HOC on a screen of my tabNavigator and I found the following problestrong textm : ScreenShot of the issue Here is an expo snack to handle the…
0
votes
1 answer

Typescript react dealing with props types

I am using react-google-maps library for Google maps api. According to documentation this is how I use maps: const GoogleMapComponent: React.ComponentClass<{}> = compose( withProps({ googleMapURL: "url", loadingElement:
yerassyl
  • 2,958
  • 6
  • 42
  • 68
0
votes
1 answer

Recompose: renderComponent gives errors with jest / enzyme testing

I have a higher order component that uses renderComponent with branch to show a loading screen when my data is still loading (the data comes from a react-apollo query): import { branch, renderComponent } from 'recompose'; const waitForLoad =…
jorgen
  • 3,425
  • 4
  • 31
  • 53
0
votes
0 answers

Pass props to generate a dynamic graphl query and wait for the data to be loaded

In my react component + recompose I am trying to load a graphql dynamically depending on some props but if I use withProps the data is always undefined. I don't understand how to connect the withProps function with the branch in order to wait for…
Elisa M.
  • 51
  • 5
0
votes
1 answer

React-recompse - Initialize property only once

I am Reactjs beginner and just started working on an existing Reactjs project that uses react-recompose module. I am trying to declare a property and initialize it using withProps. The property initialization will use few other existing properties.…
Ancient
  • 1
  • 1
0
votes
1 answer

Recompose HOC not displaying child component

So I'm hoping I'm missing something simple here. I'm trying to integrate recompose so that I can move a few functional pieces of code out of my render (dumb) component and into my HOC. The following HOC doesn't render it's child (MainReduxForm)…
Shawn Matthews
  • 1,762
  • 1
  • 15
  • 21
0
votes
0 answers

using typed hoc at untyped component

I'm gradually moving my current react project into typescript. While doing that, I've met some strange situation. // MyComponent.js import {someHoc} from 'recompose' // is typed by DefinitelyTyped. class MyComponent extends React.Component { …
FourwingsY
  • 669
  • 2
  • 7
  • 18
0
votes
1 answer

How to update state using setTimeout in recompose?

I wanted to learn recompose so I started with a simple component component: const timer: React.SFC = ({ seconds }) => ( { seconds } ); I'd like to somehow pass seconds to it using recompose, where it would increment…
simPod
  • 11,498
  • 17
  • 86
  • 139
0
votes
0 answers

Trying to create an HOC with a curry function but also needs to accept GraphQL data props (react, apollo, GraphQL, recompose)

I'm using React, recompose, and apollo GraphQL I'm trying to create UI authorization (backend auth will be there as well) to allow users with a specific role to enter pages that only they authorized to enter. I'm going off of an article that I found…
sbcreates
  • 199
  • 2
  • 11
0
votes
1 answer

using recompose, how overwrite mapped prop from state, with regular prop?

Building simple phone input form component: class PhoneSettingsScreen extends React.Component { render() { const {changePhoneInput, submitPhone, errorText, loading} = this.props return (
Ilja
  • 1,205
  • 1
  • 16
  • 33
0
votes
0 answers

Material-UI Checkbox & Switch

So what I'm trying to do is to uncheck a checkbox, or switch component when another userinput changes. Now the problem is, that the internal SwitchBase component's checked prop is changing accordingly how I want it to change, but the checked state…
0
votes
1 answer

How do I use the compose function (of redux/ramda/recompose/etc)?

I get that something like foo(bar(baz))) can be re-written as compose(foo, bar, baz). What about real-life examples, however? For instance, I may have: export default { loadData, component: connect(mapStateToProps, { actionCreator1, …
0
votes
0 answers

react-google-maps use without re-render

I Have 1 task and 1 problem. I use react-google-maps . My task is: add markers by the event. My problem - after every adding point position marker re-render component GoogleMap. And map has flicker effect if i use statefull component or HOC. I've…
0
votes
1 answer

Is there a better way to handle this redux recompose branch use case?

I have a component called PartyDetails, which needs data fetched by an ajax call. I want to show a Loading component while the ajax request is in progress. The problem is that in order to determine whether the data is loaded or not, I need access…
Geo
  • 93,257
  • 117
  • 344
  • 520
0
votes
1 answer

where to put codes I wrote in render()

I am trying to migrate to recompose, but I am a little confused: I usually write some code in beginning of render() method, for example checking values, settings styles,... If I use recompose where can I write these codes? For example this :…
AVEbrahimi
  • 17,993
  • 23
  • 107
  • 210
1 2 3
12
13