score:0
what if you lazy render the child?
that is wrap the child in a component that has button which when clicked renders the <recursive />
component
<more>
<recursive />
</more>
//more component render method
render (){
if(this.state.show){
return this.props.children
}
// show a button or something else
return <button
onclick={()=> this.setstate({show: true})}
label="view more" />
}
Source: stackoverflow.com
Related Query
- How do we improve the performance of a react application which renders the the deep nested tree data with a recursive component
- How can I improve the react performance if I have many text inputs (Hooks) in a form?
- How can I improve the architecture of my React application
- Are there ways by which we can improve the performance of a React App when it has 2 awaits in the useEffect?
- How can remove console.log in the production build of a React application created using create-react-app?
- How can I clear the localstorage when user close react application window?
- How to read the current URL in the react application
- MaterialUI TextField lag issue. How to improve performance when the form has many inputs?
- How to get JWT cookies in our react application, how to check the user is login or not I am unable to find how to handle my react application session
- How to make an electron react app, which has 2 windows - a general one and one for the Tray
- how to run my node application and react app in the same time with one command?
- How to save input entered by the user in a state which is an array in React
- How do I return two functions in a function that renders as two components in react instead of the second function overwriting the first
- How do I test a React component that calls a function on its parent, which changes props on the component?
- How react functional component can use object variable which declared behind the usage? (include example)
- How do I Display Images in React which are downloaded as Files & saved in a Folder on the Server with the Filepath stored in my Database?
- Where does the root reducer come from in this redux react example and how does dispatch knows which reducer to go?
- How to get index of the clicked images which is an item of array using React native
- How pass a function into an own react context provider which lets you edit the state?
- How to refresh a react redux application when data changes on DB outside of the application
- How do I get the react-bootstrap progress bar to display in my React application
- How can the React useContext hook be used to control application and conditional rendering?
- How to fix Too many re-renders. React limits the number of renders to prevent an infinite loop
- How to change the value of all the objects inside the expect except the one which is clicked in React js?
- How to add another route to the default react application made with create-react-app?
- How do I open my React web application without using the Console?
- How to improve React performance when change element position with a lots children element
- How to update Firebase data to the React application in realtime
- How to prevent the rerenders and improve performance (Todo example with hooks)
- How to update a useState which has an array, inside this array I have objects this objects will update when the input value will change in react js
More Query from same tag
- react typescript image resizing and download
- How can I loop through to make a list with a Link?
- How do I extend react-bootstrap component using typescript?
- Conditional return types in typescript
- multiple expressions in ternary operator with react route
- How to fire periodic actions using setTimeout and dispatcher in redux
- React: Update child with parent state change
- how to use setState in react route?
- How to use material community icons with react-native-vector-icons
- Why use redux-thunk?
- React State not updating immediatly
- React - Set State after every forEach API Request has completed
- The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0 - React Native, VS Code
- Javascript/ React.js equivalent of Ruby .select{ |x| condition }
- Warning: Failed propType: Required prop `data` was not specified in `Photo`. Check the render method of `withApollo(Photo)`
- How to re-render a particular component in React with setInterval or there is another way?
- Javascript EventSource get stuck on pending state
- useState not updating displays on first click
- React: Set checkboxes to checked on uptade form with antd
- How do I write a type definition for a a sub class (React.Component) in typescript?
- Why won't my modal close when clicking the close button?
- Laravel & React | How to implement one view per one component?
- Framer motion Animate Presence exit issue
- Sending xls via API with Java apache poi and React
- onchange input and set state not working?
- Updating props in Higher Order Components
- Flow seems to assume wrong type while iterating over Object.entries
- Redux Store Adds Duplicate Content and Navigation to Original Selection Produces Empty Array
- Redux-thunk dispatch not working
- Execute function statement only after promise is resolved