7.6.2 • Published 3 years ago

react-static-plugin-preact v7.6.2

Weekly downloads
516
License
MIT
Repository
github
Last release
3 years ago

react-static-plugin-preact

A React-Static plugin that adds support for preact

Installation

In an existing react-static site run:

$ yarn add react-static-plugin-preact

Then add the plugin to your static.config.js:

export default {
  plugins: ["react-static-plugin-preact"]
};

As final step, depending on the template you started with, you might need to remove the React Hot Reload component from index.js. Change:

  const render = Comp => {
    renderMethod(
      <AppContainer>
        <Comp />
      </AppContainer>,
      target
    )
  }

to:

  const render = Comp => {
    renderMethod(
      <Comp />,
      target
    )
  }

To preserve component state when using prefresh, it is neccesary to name the components you're exporting. Instead of

export default () => {
  return <p>Want to refresh</p>
}

You'll have to write your components like this:

const Refresh = () => {
  return <p>Want to refresh</p>
}

export default Refresh;

or

export default function Refresh () {
  return <p>Want to refresh</p>
}
7.6.2

3 years ago

7.6.1

3 years ago

7.5.0

3 years ago

7.2.2

5 years ago

7.2.0

5 years ago

7.0.10

5 years ago

7.0.8

5 years ago

7.0.0

5 years ago

7.0.0-beta.0

5 years ago

6.3.0

5 years ago

6.1.1

5 years ago

6.0.8

5 years ago

6.0.6

5 years ago

6.0.0

5 years ago

6.0.0-beta.31

5 years ago

6.0.0-beta.28

6 years ago

6.0.0-beta.27

6 years ago

6.0.0-beta.26

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago