File tree 2 files changed +12
-9
lines changed
2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "version" : " 0.1.8 " ,
2
+ "version" : " 0.1.9 " ,
3
3
"name" : " react-phone-hooks" ,
4
4
"description" : " React hooks and utility functions for parsing and validating phone numbers." ,
5
5
"keywords" : [
Original file line number Diff line number Diff line change @@ -11,14 +11,17 @@ export const jsonToCss = (stylesheet: object) => {
11
11
12
12
export const injectStyles = ( cssText : string ) => {
13
13
/** Inject the given `cssText` in the document head */
14
- const style = document . createElement ( "style" ) ;
15
- style . setAttribute ( "type" , "text/css" ) ;
14
+ try {
15
+ const style = document . createElement ( "style" ) ;
16
+ style . setAttribute ( "type" , "text/css" ) ;
16
17
17
- if ( ( style as any ) . styleSheet ) {
18
- ( style as any ) . styleSheet . cssText = cssText ;
19
- } else {
20
- style . appendChild ( document . createTextNode ( cssText ) ) ;
21
- }
18
+ if ( ( style as any ) . styleSheet ) {
19
+ ( style as any ) . styleSheet . cssText = cssText ;
20
+ } else {
21
+ style . appendChild ( document . createTextNode ( cssText ) ) ;
22
+ }
22
23
23
- document . head . appendChild ( style ) ;
24
+ document . head . appendChild ( style ) ;
25
+ } catch ( err ) {
26
+ }
24
27
}
You can’t perform that action at this time.
0 commit comments