When repurposing an array of React components, I am looking to modify the inline styles generated with them. How can I access and log the inline styles of a React component?
UPDATE: see the code snippet below:
const pieces = this.props.pieces.map((decl, i) => {
const isMoving = draggingPiece && i === draggingPiece.index;
const { x, y, piece } = decode.fromPieceDecl(decl);
const Piece = pieceComponents[piece];
return (
<Draggable
bounds="parent"
position={{ x: 0, y: 0 }}
onStart={this.handleDragStart}
onDrag={this.handleDrag}
onStop={this.handleDragStop}
key={`${piece}-${x}-${y}`}
>
<Piece isMoving={isMoving} x={x} y={y} />
</Draggable>
);
});
console.log(pieces[8].style) // encountering an error