Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
fix: package file home add
Browse files Browse the repository at this point in the history
  • Loading branch information
zeromake committed Aug 1, 2017
1 parent 3e991e3 commit 5ce4a52
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 15 deletions.
25 changes: 24 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
{
"name": "zreact",
"version": "0.0.1",
"description": "React mini",
"description": "React like,copy by preact",
"main": "dist/zreact.js",
"module": "dist/zreact.esm.js",
"jsnext:main": "dist/zreact.esm.js",
"minified:main": "dist/zreact.min.js",
"repository": "https://github.com/zeromake/zreact",
"author": "zeromake <a390720046@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/zeromake/zreact/issues"
},
"homepage": "https://github.com/zeromake/zreact",
"scripts": {
"clean": "rimraf dist/ devtools.js devtools.js.map",
"build:all": "npm run clean && npm run build:dev && npm run build && npm run build:devtools && npm run build:devtools1",
Expand All @@ -22,6 +26,25 @@
"test:karma:watch": "npm run test:karma -- no-single-run",
"changelog": "conventional-changelog -p angular-i CHANGELOG.md -s -r 0"
},
"keywords": [
"zreact",
"react",
"virtual dom",
"vdom",
"components",
"virtual",
"dom"
],
"files": [
"src",
"dist",
"devtools.js",
"devtools.js.map",
"typings.json",
"LICENSE",
"README.md",
"package.json"
],
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-loader": "^7.1.1",
Expand Down
27 changes: 13 additions & 14 deletions test/ts/prect-test.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
import { h, render, Component } from 'preact';
import { h, render, Component } from "zreact";

interface DummyProps {
initialInput: string;
initialInput: string;
}

interface DummyState {
input: string;
input: string;
}

class DummyComponent extends Component<DummyProps, DummyState> {
constructor(props: DummyProps) {
super(props);
this.state = {
input: `x${this.props}x`
}
}

render({ initialInput }: DummyProps, { input }: DummyState) {
return <DummerComponent initialInput={initialInput} input={input} />
}
constructor(props: DummyProps) {
super(props);
this.state = {
input: `x${this.props}x`,
};
}
public render({ initialInput }: DummyProps, { input }: DummyState) {
return <DummerComponent initialInput={initialInput} input={input} />
}
}

interface DummerComponentProps extends DummyProps, DummyState {

}

function DummerComponent({ input, initialInput }: DummerComponentProps) {
return <div>Input: {input}, initial: {initialInput}</div>;
return <div>Input: {input}, initial: {initialInput}</div>;
}

render(h(DummerComponent, { initialInput: "The input" }), document.getElementById("xxx"));

0 comments on commit 5ce4a52

Please sign in to comment.