Documentation request
Please document how to use forwardRef (the preferred way) to retrieve a list or array of items. For example,
const foo = React.forwardRef( (props,ref) =>
props.superHeros.map(
( hero, index) => <li ref={ ref } key={ index }>{ hero }</li>
)
)
推荐相似问题
When unmounting a Fragment node, it's children are removed from the DOM one at a time instead of all at once
Do you want to request a feature or report a bug? Bug (maybe! - or perhaps it's just a limitation of Fragments - let me
Build Failing with: 'Error: Cannot find module 'react/src/ReactCurrentOwner'
Do you want to request a feature or report a bug? report a bug What is the current behavior? I've cloned the repo onto m
"Undefined variable: performance" in react-dom for Opera Mini browsers
Do you want to request a feature or report a bug? bug What is the current behavior? When loading babel-polyfill before r
Passing all props from a parent to children looks screwed up
Do you want to request a feature or report a bug? I guess a bug. What is the current behavior? I want to wrap children i
Could hydrate stop modify the content of component, just binding events?
Since my web application run PHP server as backend, I cannot use ReactDOMServer. With lots of restrictions and conventio
`TypeError: 'undefined' is not a function (evaluating 'n.startsWith(e)')` & `React` & `AntD`
TypeError: 'undefined' is not a function (evaluating 'n.startsWith(e)') & React & AntD report a bug? TypeError: 'undefin
validateDOMNesting incorrectly validates table children
Do you want to request a feature or report a bug? bug What is the current behavior? validateDOMNesting shows warning whe
Duplicated key in list has strange behavior!
I have a list which has duplicated items. From the document, key must be unique, but I'm not sure why React concatenates
Improve warning message for failure to initialize `state` when using `getDerivedStateFromProps`
Do you want to request a feature or report a bug? bug What is the current behavior? The warning for a failure to initial
Cannot detect any clicks on elements inside google map infowindow; React
I have created a div element inside a google map infowindow using reactDomServer.renderToString and am trying to registe
基本信息
- 回复数:329
- 讨论框架:react
- 原始内容:查看信息
- 最后更新于:2020-10-23
相关讨论
- 1. Use and set a component's state within setInterval function
- 2. Bug: React function component unmounts on state change.
- 3. Bug: SuspenseList revealOrder="backwards" is not consistent without tail props
- 4. Bug: disableRemotePlayback not recognized
- 5. Bug: react test utils do not work together with esm module
3条回答
Perhaps the key question here is, why not do this?
Suppose there are 50,000
className='foo'
elements that are returned by an embedded component. Is this code not portable? Is this code slower than having 50,000ref
created?Please document this.
Could you please file this in https://github.com/reactjs/reactjs.org? That’s the documentation repo.
Done