---
name: Code
---

import {Playground, PropsTable} from 'docz'

import Code from '.'

# Code

Can be inline or block style

<Playground>
  <Code>console.log('hello')</Code>

  <Code lang="jsx" block>
    {`import React from 'react'
  import reim from 'reim'
  import {context} from 'react-reim'\n

      // create a store
      const {get, set} = reim({name: 'Peter'}).plugin(context())

      // get state already :)
      const User = () => (
        <div>{get(s => s.name)}</div>
      )

      // oh and setting state :D
      const App = () => (
        <div>
          <User/>
          {get(s => (
            <input
              value={s.name}
              onChange={ev => set({name: ev.target.value})}
            />
          ))}
        </div>
      )`}
  </Code>
</Playground>
