View webpack.js
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
const rules = require('./webpack.rules'); | |
const plugins = require('./webpack.plugins'); | |
rules.push({ | |
test: /\.css$/, | |
use: ['style-loader', 'css-loader', 'postcss-loader'], | |
}); | |
module.exports = { | |
module: { |
View install_vips.sh
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
apt-get update && apt-get install -y \ | |
build-essential \ | |
autoconf \ | |
automake \ | |
libtool \ | |
intltool \ | |
gtk-doc-tools \ | |
unzip \ | |
wget \ | |
git \ |
View Article-v3.jsx
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
import React from "react"; | |
import { LandingPad } from "./Portal"; | |
export default function Article() { | |
return ( | |
<div> | |
<LandingPad /> | |
<h1>Here is a latin article</h1> | |
<p> |
View FlashMessage-v2.jsx
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
import React from "react"; | |
import { Portal } from "./Portal"; | |
export default function FlashMessage() { | |
return ( | |
<Portal> | |
<div class="alert alert-primary" role="alert"> | |
This is a special announcement, be sure and read it! | |
</div> |
View Portal-v3.jsx
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
import React, { useRef, useEffect } from "react"; | |
import ReactDOM from "react-dom"; | |
export function LandingPad() { | |
return <div id="portal-root" />; | |
} | |
export function Portal (props) { | |
const elRef = useRef(document.createElement("div")); | |
const rootRef = useRef(); |
View Portal-v2.jsx
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
import React, { useRef, useEffect } from "react"; | |
import ReactDOM from "react-dom"; | |
export default function Portal (props) { | |
const elRef = useRef(document.createElement("div")); | |
const rootRef = useRef(); | |
useEffect(() => { | |
rootRef.current = document && document.getElementById("portal-root"); | |
rootRef.current && rootRef.current.appendChild(elRef.current); |
View FlashMessage-v1.jsx
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
import React from "react"; | |
import Portal from "./Portal"; | |
export default function FlashMessage() { | |
return ( | |
<Portal> | |
<div class="alert alert-primary" role="alert"> | |
This is a special announcement, be sure and read it! | |
</div> |
View index-v1.jsx
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
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import Article from "./Article"; | |
import FlashMessage from "./FlashMessage"; | |
import "./styles.css"; | |
function App() { | |
return ( |
View Article-v1.jsx
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
import React from 'react'; | |
export default function Article () { | |
return ( | |
<div> | |
<div id="portal-root" /> | |
<h1>Here is a latin article</h1> | |
<p> | |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | |
</p> |
View Portal-v1.jsx
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
export default class Portal extends React.Component { | |
root = null; | |
constructor(props) { | |
super(props); | |
this.el = document.createElement('div'); | |
} |
NewerOlder