Based on the create-react-app template, I'm trying to implement a very basic drag / drop scenario. My App.js
currently looks like this:
import React, { Component } from 'react';
import './App.css';
class App extends Component {
render() {
const myStyle = {
height: '100px',
width: '200px',
top: '50px',
left: '100px',
position: 'absolute',
borderStyle: 'solid',
borderColor: 'blue',
};
return (
<div className="App">
<div style={myStyle} draggable>test</div>
<div>test2</div>
</div>
);
}
}
export default App;
My question is that, from all the tutorials and documentation that I've seen, I understood the addition of the draggable
property to cause the element to be draggable, however, it is not.
What additional properties need to be set to make an object draggable
? (I'm not interested in dropping anything at this stage.)