Skip to content
Snippets Groups Projects
Commit cf84727c authored by Anthony's avatar Anthony
Browse files

Clean code after fixing ref forwarding

parent 7418127d
No related branches found
No related tags found
1 merge request!20Fix ref forwarding from Mirador to Mirador CanvasAnnotationPlugin
...@@ -108,12 +108,6 @@ export class CanvasAnnotations extends Component { ...@@ -108,12 +108,6 @@ export class CanvasAnnotations extends Component {
const annotationCount = annotations.length; const annotationCount = annotations.length;
console.log('CanvasAnnotations containerRef : ', containerRef);
if (!containerRef.current) {
return <div>containerRef is null</div>;
}
return ( return (
<> <>
<Typography sx={{ paddingLeft: 2, paddingRight: 1, paddingTop: 2 }} variant="overline"> <Typography sx={{ paddingLeft: 2, paddingRight: 1, paddingTop: 2 }} variant="overline">
......
...@@ -15,7 +15,7 @@ export class ScrollTo extends Component { ...@@ -15,7 +15,7 @@ export class ScrollTo extends Component {
/** */ /** */
componentDidMount() { componentDidMount() {
const { scrollTo, containerRef } = this.props; const { scrollTo } = this.props;
if (!scrollTo) return; if (!scrollTo) return;
this.scrollToElement(); this.scrollToElement();
......
...@@ -51,10 +51,17 @@ const mapDispatchToProps = { ...@@ -51,10 +51,17 @@ const mapDispatchToProps = {
selectAnnotation: actions.selectAnnotation, selectAnnotation: actions.selectAnnotation,
}; };
// const enhance = compose(
// withRef(),
// withTranslation(),
// connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true }),
// withPlugins('CanvasAnnotations'),
// );
const enhance = compose( const enhance = compose(
withRef(), withRef(),
withTranslation(), withTranslation(),
connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true }), connect(mapStateToProps, mapDispatchToProps),
withPlugins('CanvasAnnotations'), withPlugins('CanvasAnnotations'),
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment