Unable to make 3.0.0-alpha.7 work with react 16.9
See original GitHub issueI have the following code:
const MyComponent = props =>
<div>
<Reorder
reorderId="research"
className={"reorder"}
lock="horizontal"
holdTime={500}
onReorder={() => {console.log("reorder")}}
autoScroll={true}
disabled={false}
disableContextMenus={true}>
{["1","2","3","4"].map(v => <Cell key={v} name={v} />)}
</Reorder>
</div>
const Cell = props =>
<div style={{
backgroundColor: "lightpink",
border: "1px solid green",
padding: 20,
userSelect: "none"}}>{props.name}</div>
It doesn’t seem to work and I feel stupid for asking but am I missing something?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
"Could not resolve dependency" error with "react@^16.0" #9426
Current Behavior Installing @react-navigation/stack fails due to dependency error. How to reproduce I've just created a new react-native ...
Read more >Could not resolve dependency error peer react@"^16.8.0
While trying to install npm install , I am getting below error, could someone please advise, what is the best approach to resolve...
Read more >unable to resolve module react-native-elements - You.com
This error means that either you haven't installed the react-navigation module or that you have installed the module but didn't re-built your project...
Read more >React v16.9.0 and the Roadmap Update
Today we are releasing React 16.9. It contains several new features, bugfixes, and new deprecation warnings to help prepare for a future ...
Read more >Material UI 14 dependency issue - JSON Forms community
I want to use JSONForms in my react typescript project that uses react v17, material ui v5. I setup a separate “trial project”...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hooks Implementation: @JakeSidSmith @tjimsk
You would have useState declared or useSelector if you are using Redux. For this example I am using useState for now.
const [photos, setPhotos] = useState([])
You would then set your state within the useCallback hook expanding upon bullet point number 1. In this example I have the set state reference declared as setPhotos.
For the Reorder component, I pass in the hook reference: onReorder={OnReorder}.
I’m creating a Tinder Clone and wanted to have something similar to their drag and drop system.
I managed to replicate 90% of the same look.
Side Note
I was searching for a drag and drop reorder component and stumbled upon two. However, I haven’t played around with the second option and I believe it doesn’t have callback functionality but I could be wrong. Leaving this here in case it could help others:
Hey, @tmm1 could you please open a pull request, or new issue?