-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17b62a2
commit b09d3f6
Showing
6 changed files
with
1,355 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React, { useState, useEffect, useContext, useLayoutEffect } from 'react'; | ||
import { ExtensionContextData, ExtensionContext } from '@looker/extension-sdk-react'; | ||
import { Code } from '@looker/components'; | ||
import styled from 'styled-components' | ||
|
||
export function CoolApp() { | ||
// var ref = React.createRef(); | ||
const [me, setMe] = useState({}); | ||
const extensionContext = useContext<ExtensionContextData>(ExtensionContext) | ||
const sdk = extensionContext.coreSDK | ||
|
||
// ref.sdk = sdk; | ||
|
||
useEffect(()=>{ | ||
apiCall(); | ||
},[]) | ||
|
||
const apiCall = async () => { | ||
const me = await sdk.ok(sdk.me()) | ||
setMe(me) | ||
} | ||
|
||
useLayoutEffect(()=>{ | ||
var pp = document.getElementById('pp-div'); | ||
var new_pp = document.createElement('ping-pong'); | ||
new_pp.sdk = sdk; | ||
pp?.appendChild(new_pp); | ||
},[]) | ||
|
||
return ( | ||
<div id="pp-div"> | ||
|
||
</div> | ||
); | ||
} | ||
|
||
const StyledCode = styled(Code)` | ||
white-space: pre; | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.