)
-}
+})
+
+Container.displayName = 'Container'
+
+export default Container
diff --git a/src/lib/index.jsx b/src/lib/index.jsx
index 4836cec..6db85c6 100644
--- a/src/lib/index.jsx
+++ b/src/lib/index.jsx
@@ -28,12 +28,12 @@ const propDefaults = {
Clear: () => '\u00d7'
}
-const render = (Component, componentProps, pluginIndex) => {
+const render = (Component, componentProps, pluginIndex, ref) => {
const p = Array.isArray(componentProps.plugins) && componentProps.plugins[pluginIndex]
if(p) {
const [Plugin, pluginProps] = Array.isArray(p) ? p : [p]
- return
{
render
}} />
}
- return
+ return
}
-export default function Turnstone(props) {
+const Turnstone = React.forwardRef((props, ref) => {
const componentProps = {...propDefaults, ...props}
return (
- { render(Container, componentProps, 0) }
+ { render(Container, componentProps, 0, ref) }
)
-}
+})
+
+Turnstone.displayName = 'Turnstone'
+
+export default Turnstone
//////////////////////////////////////////////////////
// Prop validation //