Browse code
Adding try/catch in action-link require('react') so that React is not a project dependency
Max Summe authored on 19/06/2017 22:38:30
Showing 1 changed files
Showing 1 changed files
... | ... |
@@ -1,5 +1,8 @@ |
1 |
-import React from 'react'; |
|
2 |
- |
|
1 |
+try { // making this optional dependency b/c it's automatically exported but only |
|
2 |
+ // useful when react is installed |
|
3 |
+ const React = require('react'); |
|
4 |
+} catch(e) { |
|
5 |
+} |
|
3 | 6 |
|
4 | 7 |
export default function ActionLink({action, children}, {store}) { |
5 | 8 |
|