This file contains hidden or 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
| import { ReactElement } from "react"; | |
| import deconstructChildren from "./deconstructChildren.ts"; | |
| export default function ChildComponent({ children = [] }: { children?: ReactElement[] }) { | |
| let { TitleText, SubText } = deconstructChildren(children); | |
| return ( | |
| <div> | |
| {TitleText ? <h1>{TitleText}</h1> : <div>Fallback Text</div>} | |
| <p>We want to use the two components in two different place in the code. They might be sepeterated by other components, or we might want to show some parts conditionally.</p> | |
| <span>{SubText}</span> |
This file contains hidden or 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
| package main | |
| import ( | |
| "os" | |
| "os/exec" | |
| ) | |
| func Start(args ...string) (p *os.Process, err error) { | |
| if args[0], err = exec.LookPath(args[0]); err == nil { | |
| var procAttr os.ProcAttr |