react-primitives-textinput

0.1.0 • Public • Published

react-primitives-textinput

Cross platform <TextInput> component for React.

Getting Started

Setting up Resolver

You need to setup a resolver to use the correct file for your platform.

You can do this with a custom Webpack or Rollup config.

e.g. for web:

webpack.config.js

const baseConfig = { ... };
 
module.exports = {
  resolve = {
    ...baseConfig,
    extensions: [
      '.web.js',
      '.web.jsx'
      ...baseConfig.resolve.extensions,
    ]
  };
};

Building a Shared TextInput Component:

import TextInputPrimitive from 'react-primitives-textinput';
 
const TextInput = (props) => (
  <TextInputPrimitive {...props} />
);
TextInput.defaultProps = {
  style: {
    borderWidth: 1,
    borderColor: 'gray',
  }
};
 
export default TextInput;

Readme

Keywords

none

Package Sidebar

Install

npm i react-primitives-textinput

Weekly Downloads

8

Version

0.1.0

License

ISC

Unpacked Size

7.22 kB

Total Files

14

Last publish

Collaborators

  • macintoshhelper