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
1 answer

Unit test for compose HOC

How can I test this HOC with Enzyme? I've tried shallow but it covers only 40% of component. export default compose( withState('showDropdown', 'handleDropdown', false), withHandlers({ handleClickOutside: props => () => { …
Emil Kuluev
  • 25
  • 1
  • 4
0
votes
1 answer

How to find unnamed component that throws warning

I have the following warnings in console: I can see it is a recompose component but have no idea where to find it. Here is too many components in the page.
Guo Yunhe
  • 67
  • 1
  • 10
0
votes
0 answers

How to multiply one stateless component so that each component of the list has an independent state?

I have a stateless component using the recompose library The file is a container: import { connect } from 'react-redux'; import { compose, withState, withHandlers, } from 'recompose'; import PropTypes from 'prop-types'; import…
sinevitch
  • 13
  • 3
0
votes
1 answer

updating the state for react-dates

I'm trying to use airbnb react-dates as follows: function NewEntryModal(props) { return { }} render={props => (
Student
  • 155
  • 1
  • 2
  • 10
0
votes
2 answers

Unable to spyOn imported function in compose block under componentDidMount

Having some issues using spyOn for testing a method call inside my compose() block for my Reactjs app using recompose, redux, etc. Basic layout is this: // index.jsx import { foo, baz } from './lib'; const enhance = compose( foo(), lifecycle({ …
jerbotron
  • 307
  • 1
  • 4
  • 14
0
votes
1 answer

How do I combine ramda with recompose?

I have this component; const ReposGrid = R.pipe( R.prop("repos"), // branch(R.isEmpty, renderComponent(Loader)), R.map(Repo), ReposWraper ) export default ReposGrid This works fine but I want to render loader component if repos is…
karolis2017
  • 2,195
  • 8
  • 24
  • 49
0
votes
0 answers

Write WithState in a Child Component in Recompose

Question №1 Is it right to write WithState in a Child Component in Recompose? Yes? How can I transfer a state from a Child Component to a Parent Component? Question №2 Is it right to write WithState and withHandlers in the Parent Component?
0
votes
1 answer

Use react-google-maps methods with recompose

I'm using react google maps for fine tuning the user location after a geo location function, this is part of my Map.js code: const MyMapComponent = compose( withProps({ googleMapURL:…
BetoCuevas
  • 123
  • 8
0
votes
2 answers

Google Maps React - Making my markers clickable

So I kinda got lost and I tried several codes. I managed to implement the markers however I think i'm doing something incorrect to make them actually clickable and display an InfoWindow.
0
votes
1 answer

Using recompose branch within a React container component

I have a container component for a modal. It imports LabelDetailForm, which is adds the modal's content to the page using React portals. import {compose, branch} from 'recompose' import {actionCreators as uiActionCreators} from…
depiction
  • 772
  • 6
  • 16
0
votes
0 answers

redux form data is not preserved

I have used redux-form for the form. I have developed a wizard considering an example from the documentation. The wizard is working but when i go to step 2 i.e SyncAccount component which has the form and fill that form and hit the next button to go…
Serenity
  • 3,884
  • 6
  • 44
  • 87
0
votes
0 answers

filter with mapPropsStream doesn't work

i'm trying to create a filter with mapPropsStream but it does not work. This is my code: const BaseComponent = ({ onSearch, data }) => (
onSearch(target.value)} />
Gabriel
  • 41
  • 3
0
votes
1 answer

Recompose async prop update

How to rerender component with recompose, when prop is changed from outside the view component? const Message = ({msg}) =>
The prop has a value of {msg}.
const App = Recompose.withProps(() => { let msg = 'One' // this async…
simPod
  • 11,498
  • 17
  • 86
  • 139
0
votes
1 answer

GraphQL Fragments error on export to query

So I have a reactjs app using GraphQl and I'm trying to cut down the repetition through the use of fragments, however, its failing. Fragment (companyQueries.js) export const CompanyFragment = gql` fragment company on WithApiKeys { company { …
0
votes
0 answers

React Google Maps: display Markers on MapWithADirectionRenderer recompose Component

I have my component MapWithADirectionsRenderer defined like here var markers = []; const MapWithADirectionsRenderer = compose( withProps({ googleMapURL: "https://maps.googleapis.com/maps/api/js?...", loadingElement:
batt
  • 3,382
  • 2
  • 11
  • 12